Web to React Native: Possible with the postMessage method and onMessage prop exposed by React Native WebView.
What about when the web page wants to communicate back to your React Native code? This is where window.ReactNativeWebView.postMessage and the onMessage prop come in.
You must set onMessage or the window.ReactNativeWebView.postMessage method will not be injected into the web page.
window.ReactNativeWebView.postMessage only accepts one argument which must be a string.
SOURCE: https://github.com/react-native-webvi...
LINK: https://www.educative.io/answers/how-...