DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 970,177 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Developer Ruhul
Developer Ruhul

Posted on

How to make react router replace component only after the matched route asynchronously loaded..?

So here's the situation - When a Link is clicked the nprogress bar will start and I want react-router to only replace the current component with the matched route once that's done loading asynchronously.. just like in instagram..

enter image description here

But I am only getting this -

enter image description here

I didn't find a solution to this anywhere on the internet.. so I am asking this question here in dev. I am hoping someone here can solve this.

Top comments (5)

Collapse
 
dukemai profile image
dukemai

I think React Transition Group is something you are looking for

Collapse
 
sagar profile image
Sagar

Can you share sample codebase.it helps us finding solutionπŸ’ͺπŸ˜„πŸ‘Œ

Collapse
 
developerruhul profile image
Developer Ruhul Author

did u find any solution??

Collapse
 
sagar profile image
Sagar

I'm trying to solve this issue. In ours project we have implemented react-lodable. Your facing flicker issue. Definitely solution is to provide delay in 5000.

Collapse
 
developerruhul profile image
Developer Ruhul Author

🌚 Life is too short to browse without dark mode