Preload React Components with the useEffect Hook

Share this video with your friends

Send Tweet

While users are filling out the form on our home page, it would be a good idea to pre-load the next page they will be going to so they don't have to wait for it to load once they've finished filling out the form. React's useEffect hook makes this really easy.

Freisha
Freisha
~ 5 years ago

How can this be used in large scale application with more than one route in a clean way?

~ 2 years ago

hey i want to ask about this preload isn't it just undo what react lazy does? because you get the file on home load and not when the component neede? and does this preload only can be use when you really know that user can only go to that file next?