react-lazy-preload-demo | Lazy loading components in React | Blog library
kandi X-RAY | react-lazy-preload-demo Summary
kandi X-RAY | react-lazy-preload-demo Summary
Versions (find the code in the Pull Request list):.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-lazy-preload-demo
react-lazy-preload-demo Key Features
react-lazy-preload-demo Examples and Code Snippets
Community Discussions
Trending Discussions on react-lazy-preload-demo
QUESTION
react-loadable
exposes a very nice method YourLoadableComponent.preload()
thanks to which you can easily preload component before it gets rendered whenever you want (onMouseOver
etc).
I can see I can do something like: https://github.com/pomber/react-lazy-preload-demo/pull/8/commits/126c1bf6e2a23b3e3f7eb0ffb1b4db260516643f
so to call import()
manually, store the resulting Promise
in some variable and then pass it to React.lazy()
. However it can be a bit too verbose and problematic if I wanted to preload on some class method call or in lifecycle hook.
Any other alternatives to above approach?
...ANSWER
Answered 2019-Nov-17 at 05:26You can give https://github.com/ianschmitz/react-lazy-with-preload a try. Seems to suite your use case nicely!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-lazy-preload-demo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page