DEV Community

Developer Ruhul
Developer Ruhul

Posted on

2 1

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 β€’

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 β€’
πŸ‘‹ Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay