I am trying to get a scroll event back to react from a webview. According to the doc it seems that the way to go is using postMessage and injectedJavascript.
Here is my code
<CustomWebView
injectedJavaScript="window.addEventListener('scroll', function(event) {window.ReactNativeWebView.postMessage(JSON.stringify(event));});true;"
onMessage={event => {
console.log(event.nativeEvent.data);
}}
applicationNameForUserAgent="App"
ignoreSslError
useWebKit
source={{ uri: net.uri }}
startInLoadingState
/>
The onMessage part seems to be doing something because I am getting this in the logs for every scroll event, however no direction
{"isTrusted":true}
What have I missed?