Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shqld/react-native-auto-expanding-webview

Auto-expanding WebView for React Native
https://github.com/shqld/react-native-auto-expanding-webview

android ios reactnative webview

Last synced: 17 days ago
JSON representation

Auto-expanding WebView for React Native

Awesome Lists containing this project

README

        

# react-native-auto-expanding-webview
Auto-expanding WebView for React Native

## Feature
This can be nested in `ScrollView`

### Why this?
This module
- fully accepts all props of `WebView` in React Native for customizability
- is written only in JavaScript

## Requirements
This module has not yet been tested
in every version except for:
- `react`: `16.0.0-alpha.12`
- `react-native`: `0.47.1`

## Installation
```sh
$ npm install react-native-auto-expanding-webview
```

## Props
- `LoadingViewComponent`: `ReactClass` | `React.Element`
- `onLoad`: `(contentHeight) => void`

## Example
```jsx
import { ScrollView, Text, ActivityIndicator, Dimensions } from 'react-native';
import AutoExpandingWebView from 'react-native-auto-expanding-webview';

const embedHtml = (html) => `


${html}

`;

const Content = ({ children }) => (
console.log(contentHeight)}
/>
);

const Title = ({ children }) => (

{ children }

);

const Footer = ({ children }) => (

{ children }

);

const ArticleView = ({ article }) => (

{ article.title }
{ article.content }
{ article.footer }

);
```