Load WebView on initial render
See original GitHub issueBug description:
I’m trying to preload my WebView in a tab using React Navigations Bottom Tabs Navigator and the prop lazy set to false
so that the screen is loaded on initial render.
Unfortunately while the screen renders the actual WebView component does not until the tab is active, this appears to only affect iOS.
To Reproduce:
Set lazy: false
to screenOptions prop of Tab.navigator or options prop of Tab.Screen and render WebView as a component on the screen.
Expected behavior: WebView component should be loaded on initial render.
Environment:
- OS: iOS
- OS version: 15.4
- react-native version: 0.67.4
- react-native-webview version: 11.17.2
If there are other known working solutions to preload WebView please let me know.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:12
Top Results From Across the Web
How to start loading a WebView after the view is rendered?
The first WebView works fine, but by the time the subsequent WebViews are displayed, their animations are already completed since they have ...
Read more >WebView
WebView renders web content in a native view. ... Boolean value that forces the WebView to show the loading view on the first...
Read more >React Native WebView - Loading Websites and HTML in ...
First, we learned how to render simple HTML content using the WebView component. Then, we got a detailed explanation of how to use...
Read more >Suggestions for WebView pre-loading and pre-rendering
One thing we're looking at is pre-loading WebView HTML/JS/resources. This can be done either in the native code side with shouldInterceptRequest injections ...
Read more >Reset React Native WebView to initial url | by Andrei Pfeiffer
However, that doesn't help, because it reloads the current page, not the one that was loaded initially. Solution #2: Forcing a re-render. What ......
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
We are experiencing the same issue on our React Native App which is causing a terrible user experience. When a user switches to a tab using the bottom tab bar there have to wait nearly 5 seconds for the Webview to load. If the above issue was fixed it would be amazing as the Webview would already be loaded when the user lands on that tab.
+1