Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

loading experience for IndexRedirect react router

I’m wondering how the loading experience is for the IndexRedirect. In this example:

<Route path="/" component={App}>
  <IndexRedirect to="/welcome" />
  <Route path="welcome" component={Welcome} />
  <Route path="about" component={About} />
</Route>

Does it load the App component first and then redirect to the welcome path or how does it work?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Does it load the App component first and then redirect to the welcome
path or how does it work?

Actually, just took a look at the docs you linked and I’d agree with your assessment. The App component would be mounted and then its React subtree, i.e. its children prop, would be rendered. The IndexRedirect is the default route/redirect component so the app would be redirected to "/welcome" and then mount & render the Welcome component (and its React subtree).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading