D
D
dpablo_escobarr2021-01-19 15:47:39
React
dpablo_escobarr, 2021-01-19 15:47:39

How can you do asynchronous actions before moving to a new route without showing it?

I want to understand how to make a pre-request, for example, before entering the Route path='/users' component=Users So that before rendering this component some kind of asynchronous action is activated, and then the component is drawn. That is, something like this but which is not there:
6006e703c5bcf741432083.png
After receiving a response from the server, we throw it into the component and draw it. The preloader is not needed, you can wait on the parent component for a request to the server.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question