I
I
Ivan2019-03-02 20:43:34
React
Ivan, 2019-03-02 20:43:34

How to show a component in react-router only after it is fully loaded?

How to show a component in react-router only after it is fully loaded?
Those. after clicking on the Link , the url changed and the data began to load, but the previous component is still on the screen, only after all the data is loaded, you need to show the current one

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hzzzzl, 2019-03-03
@hzzzzl

even I'm not sure what this will work ..
make a custom Link component that will first load new data, and only then update the state or something else so that the content is redrawn?
otherwise the React Link immediately changes the url, that's all, then the router immediately updates everything

J
Jedi, 2019-03-03
@PHPjedi

React Suspense.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question