Предыдущая версия не работает как новая.
"Reaction-native-webview": "^ 9.0.2" "Reaction-native": "0.62.0",
2. webview options
javaScriptEnabled={true}
mediaPlaybackRequiresUserAction={false}
startInLoadingState={true}
allowUniversalAccessFromFileURLs={true}
onMessage={this.respondToOnMessage}
3. react-native code
this.webView.postMessage( "Post message from react native" );
4. web code
function receiveMessage(e) {
callbackFunction(JSON.parse(e.data));
}
function RNPostMessage(data) {
window.ReactNativeWebView.postMessage(data);
}
window.addEventListener('message', receiveMessage, true);
5. react-native error msg
D:\dev\projects\mobile-app\react-native\yc_attend\node_modules\react-devtools-core\dist\backend.js:32 Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'postMessage' of undefined
TypeError: Cannot read property 'postMessage' of undefined
Я хочу знать решение этой проблемы ...