Reputation: 11
How to pass variables using javascript from react native to the webview and use these variables inside html code in the webview?
Upvotes: 1
Views: 1153
Reputation: 1253
You need to add injectedJavascript
to your WebView
.
Follow this link for official documentation: https://facebook.github.io/react-native/docs/webview.html#injectedjavascript
Here is an example: https://www.undefinednull.com/2015/12/27/injecting-custom-javascript-into-react-natives-webview/
Upvotes: 1