Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: previous route is still rendered during navigation with loader #12130

Closed
youri-oliver opened this issue Oct 15, 2024 · 3 comments
Closed
Labels

Comments

@youri-oliver
Copy link

What version of React Router are you using?

6.15.0

Steps to Reproduce

https://stackblitz.com/edit/github-fmmzla

Click on "A route" and navigate to "B route"

Expected Behavior

During navigating from A to B, the A component should not be rendered...

Actual Behavior

During navigation from A to B, the A is still rendered. After the loader is finished with the setTimeout, the A is removed.

@youri-oliver
Copy link
Author

Possible solution, but it feels kinda weird

{loading ? <Loader /> : <Outlet />}

The <Outlet /> should update itself?

@timdorr
Copy link
Member

timdorr commented Oct 15, 2024

@timdorr timdorr closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
@youri-oliver
Copy link
Author

@timdorr So the <Outlet /> in the docs should be conditional as my "possible" solution, right? Else you are gonna have the problem I described...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants