Search code examples
androidiosreact-nativeprogressive-web-appsreact-native-webview

React Native Webview - Opening same URL even after updating via state


I'm facing issue react-native-webview . The issue is like opening app initial I have set URL in state but when the new URL comes up from push notification then its not updating the webview even after updating the state.

Please help me if any one has the solution for the same.


Solution

  • Define a reference for webview like given below and call webViewRef.reload(), when you want to reload the webview

    <WebView 
     ref={(ref) => {
              this.webViewRef = ref
            }} 
     />