How to pass variables using javascript from react native to the webview and use these variables inside html code in the webview?
1 Answer
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/
1 Comment
Iman Sharabati
I tried to do that, but when I call this variable from the code inside the webview it gives me that "the variable is undefined..".. can you please give me a full example? pass variable and then use it in html code?