79096933

Date: 2024-10-17 07:12:07
Score: 1
Natty:
Report link

You can go to react-native-webview repo and see some more functions for this.

For simple i am writing down it here.

<WebView
  {...restProps}
  source={{uri}}
  onLoadStart={()=>setloading(true)}
  onLoadEnd={()=>setloading(false)}
  onLoad={()=>setloading(false)}
  style={{ flex: 1 }}
  injectedJavaScript={INJECTEDJAVASCRIPT}
  scrollEnabled
  setSupportMultipleWindows={false} //This will solve your problem
  useWebView2={true}//Function that is invoked when the `WebView` should open a new window.
  javaScriptCanOpenWindowsAutomatically={true}//A Boolean value indicating whether JavaScript can open windows without user interaction.

You can check more about it from repo.

https://github.com/react-native-webview/react-native-webview/blob/master/src/WebViewTypes.ts#L793

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Harshit Saxena