Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView Navigation url is not getting updated #24415

Closed
harryharihar opened this issue Apr 11, 2019 · 2 comments
Closed

WebView Navigation url is not getting updated #24415

harryharihar opened this issue Apr 11, 2019 · 2 comments
Labels
Bug Component: WebView Related to the WebView component. Resolution: Locked This issue was locked by the bot.

Comments

@harryharihar
Copy link

harryharihar commented Apr 11, 2019

I am using webview to navigate next webpage but whenever i clicked on link of webview , the Navigation url remains same

i have some logic like want to show and hide my view on webview clicked

react native info :
React Native version: react-native-cli: 2.0.1
react-native: 0.57.8

code:

<WebView
ref={webView => { this.refWeb = webView; }}
style={{
height:320,
justifyContent: 'center',
alignItems: 'center',

          }}
         scrollEnabled={true}
          //Loading URL
          source={
            {
             
              uri: initialUrl.DOMAIN_URL,
              headers: {
                Authorization: "Basic YmV0YTp2ZWVuYXdvcmxkMTIz",
                client: "APP"
              }
            }
          }
          //Enable Javascript support
          javaScriptEnabled={true}
          //For the Cache
          domStorageEnabled={true}
          //View to show while loading the webpage
          renderLoading={()=>this.DotIndicatorLoadingView()}
          //Want to show the view or not
          injectedJavaScript={injectScript} 
          automaticallyAdjustContentInsets = {true}
          startInLoadingState={true}
          onNavigationStateChange={this.onNavigationStateChange}
          
        />  

onNavigationStateChange = (navState) => {
console.log(navState);
if(navState.url===initialUrl.DOMAIN_URL){
this.setState({
canGoBack: navState.canGoBack,
canGoForward: navState.canGoForward,
changedUrl:false
})
}else{
this.setState({
canGoBack: navState.canGoBack,
canGoForward: navState.canGoForward,
changedUrl : true

  })
}

}

Environment

VSCode version: 1.30.2(user)
OS platform and version: Windows 10
NodeJS version: 8.9.3
skip envinfo

@react-native-bot react-native-bot added the Component: WebView Related to the WebView component. label Apr 11, 2019
@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.

@hey99xx
Copy link

hey99xx commented Apr 11, 2019

There's no webview component in react-native in the latest releases, it's extracted out to https://github.com/react-native-community/react-native-webview please open your issues there.

@facebook facebook locked as resolved and limited conversation to collaborators Apr 12, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: WebView Related to the WebView component. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants