<WebView source={{ html: "<h1>Hello</h1>" }} />
Documentation available here: http://facebook.github.io/react-native/docs/webview.html#content
Answer from John Shammas on Stack OverflowHow to Load local HTML and local js in react-native-webview in IOS?
Load local html file
Videos
» npm install react-native-html-webview
<WebView source={{ html: "<h1>Hello</h1>" }} />
Documentation available here: http://facebook.github.io/react-native/docs/webview.html#content
Have you upgraded React Native version?
It is deprecated on newer versions, check the documentation. If you are using older version of React Native, you should use html instead of source.
» npm install react-native-htmlview
I am trying to load a charting library in webview. I have tried many answers on StackOverflow and GitHub but I was only able to display it correctly on Android using {uri: 'file:///android_asset/www/index.html'} but on iOS when I do import HTML_FILE from "./resources/index.html"; ORconst HTML = require('./resources/index.html'); it doesn't work.
The app shows a blank screen, and the metro bundler throws resources/highcharts/highcharts.js' cannot be loaded as its extension is not registered in assetExts.
PS:I followed similar approach for iOS : https://aboutreact.com/load-local-html-file-url-using-react-native-webview/
I have added simmilar question on StackOverflow as well : https://stackoverflow.com/questions/57726507/add-local-html-and-js-file-using-react-native-webview
PPS :"react-native": "0.60.5","react-native-webview": "^7.0.1"
I do not use EXPO