How to make react to draw the component from scratch?

Good day, please tell me how to React to tell the component that it was rendered with 0. Used a bunch of React+redux+react-router. There is a main page and page-type /?id=uiid64. And when you go to the url /?id=uiid64 indicates the previous state, and then it changes. I would like to render this page with 0.
July 4th 19 at 22:52
1 answer
July 4th 19 at 22:54
Solution
In reducer'e make a variable such as isFetching status true/false when an asynchronous request (on the REQUEST to true, false on SUCCESS).

In the component template stylesuite this point variable isFetching as you like: for example, show a preloader, which completely covers the previous data and somehow animated. The most primitive example:

...
render()
...
 if (this.props.isFetching) {
 <p> Loading...</p>
 } else {
 <p> {WASHINE} </p>
 }
Such a variable is, just while loading the data already shows previous uploaded. - donavon commented on July 4th 19 at 22:57
I understand perfectly your sitaula, you just need to stylize it. - dannie.Stehr commented on July 4th 19 at 23:00
for example, show div if isFetching === true, and this div background solid white background (or whatever background you have), and in the middle of this diva - gear turns. When the state isFetching will change to false you div will hide and new data. - dannie.Stehr commented on July 4th 19 at 23:03
: good) thank you) I will try) I think there is a possibility to make it native to draw with 0 - donavon commented on July 4th 19 at 23:06
: I somehow even did not think about this =) then you can just put if (isFetching) return null and all) will be "nothing." - dannie.Stehr commented on July 4th 19 at 23:09
: if you succeed, celebrate the decision, if not - write. - dannie.Stehr commented on July 4th 19 at 23:12
: here just tried all worked perfectly. Of course when you debug if you put a point on this condition, the previous data is visible. But even with a slow Internet everything works perfectly and the download of a component occurs from scratch. Thank you) - donavon commented on July 4th 19 at 23:15

Find more questions by tags JavaScriptReactRedux