onNavigationStateChange triggered twice when url change
See original GitHub issueBug description:
when i an in www.a.com
, and run window.location.href='www.b.com'
, onNavigationStateChange
triggered twice, and the two callback has the same url: ‘www.b.com’; and when i go back, onNavigationStateChange
also triggered twice, and the url are all www.a.com
Expected behavior:
onNavigationStateChange
trigger only once on every url change
Screenshots/Videos:
Environment:
- OS: android/ios
- OS version:
- react-native version: 0.62.2
- react-native-webview version: 10.3.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
onNavigationStateChange triggered twice when url change
Bug description: when i an in www.a.com , and run window.location.href='www.b.com' , onNavigationStateChange triggered twice, ...
Read more >onNavigationStateChange is rendering twice in react native ...
Whatsoever is in this function, everything is getting called twice. I am unable to figure out why this is happening??
Read more >A brand new website interface for an even better experience!
onNavigationStateChange triggered twice when url change.
Read more >Using WebView with React Navigation | by Damien Mason
To do that we're going to use onNavigationStateChange , and the first step ... which is that onNavigationStateChange is called twice , which ......
Read more >onnavigationstatechange react native webview
Function that is invoked when the WebView has finished loading. onNavigationStateChange triggered twice when url change #1584 You could find ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@atalshrivastava I’ve just checked, the object from
onNavigationStateChange
gives a propertyloading
and I am calling the required function when loading isfalse
.@iamrohitagg’s method of using the
loading
variable seems to work for me too