react-native-webview
provides a WebView
component that renders web content in a native view.Android Device | Android Emulator | iOS Device | iOS Simulator | Web |
---|---|---|---|---|
expo install react-native-webview
If you're installing this in a bare React Native app, you should also follow these additional installation instructions.
import * as React from 'react'; import { WebView } from 'react-native-webview'; export default class App extends React.Component { render() { return <WebView source={{ uri: 'https://expo.io' }} style={{ marginTop: 20 }} />; } }
import * as React from 'react'; import { WebView } from 'react-native-webview'; export default class App extends React.Component { render() { return ( <WebView originWhitelist={['*']} source={{ html: '<h1>Hello world</h1>' }} style={{ marginTop: 20 }} /> ); } }