I am trying to call webview button click function on my own button click function but nothing seems to work. My code is similar to this
buttonClick = () => {
this.webview.injectJavaScript(`document.getElementById('webBtn').click()`);
}
redner(){
return(
<View>
<WebView
source={{uri: 'https://mywebsite.com'}}
/>
<TouchableOpacity onPress={() => this.buttonClick()}><Text> Click here </Text></TouchableOpacity>
</View>
)
}
I have tried the same Method with javascript It works Perfect there but I don't why its creating issues with the WebView in react Native . Any help would be Appreciated.