mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-10 09:12:46 +08:00
Fix WebView not to double load the URL
Reviewed By: andreicoman11 Differential Revision: D2823397 fb-gh-sync-id: deb04ab22bee7022bc8bcb61fa4c24f86eddbaa8
This commit is contained in:
committed by
facebook-github-bot-5
parent
1abd12b68b
commit
393adacfa6
@@ -286,6 +286,12 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
|
||||
// TODO(8495359): url and html are coupled as they both call loadUrl, therefore in case when
|
||||
// property url is removed in favor of property html being added in single transaction we may
|
||||
// end up in a state when blank url is loaded as it depends on the order of update operations!
|
||||
|
||||
String currentUrl = view.getUrl();
|
||||
if (currentUrl != null && currentUrl.equals(url)) {
|
||||
// We are already loading it so no need to stomp over it and start again
|
||||
return;
|
||||
}
|
||||
if (url != null) {
|
||||
view.loadUrl(url);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user