How to render a web page in your React Native apps?
use React Native Webview
I haven't wrote react native apps for years. Recently I start work on react native again. just learned:
React Native WebView is a modern, well-supported, and cross-platform WebView for React Native. It is intended to be a replacement for the built-in WebView (which will be removed from core).
GitHub - react-native-webview/react-native-webview: React Native Cross-Platform WebView
React Native Cross-Platform WebView. Contribute to react-native-webview/react-native-webview development by creating an account on GitHub.
Example Code
Note: Please at least set a height for the Webview component or its parent. Otherwise, the web page will not be displayed on your screen.
const Word = ({ word, src }: WordProps) => {
return <View style={{ minHeight: 400, height: "100%" }}>
<WebView source={{ uri: src }}
style={{/** height:400 */}}
></WebView>
</View>
}
