onMessage = e => {
console.log('onMessage', typeof (e.nativeEvent.data), e.nativeEvent.data);
};
<WebView
source={{
uri: this.state.chosenCityUrl,
}}
javaScriptEnabled={true}
ref={(b) => this._bridge = b}
onMessage={event => this.onMessage(event)}
injectedJavaScript="setTimeout(() => {document.addEventListener('scroll', function (event) {window.ReactNativeWebView.postMessage(JSON.stringify({top:document.getElementsByClassName('topconteiner')[0].scrollTop}));},true);}, 300);true;"
/>