How to implement standalone modal routes? #6243
Unanswered
evertdespiegeleer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to accomplish the following.
I want to add a route to my application (
/settings). It's got subroutes, layout logic etc; A proper, serious route like any other.There is one thing which is special about it:
The uppermost layout component of this route makes it a modal. It's a little silly if the background behind a model disappears when it opens, so I'd like to keep the background in place.
Essentially, I'd like to have two routes rendered at the same time:
If no previous route exists, nothing should be rendered in the background.
I can come up with all sorts of workarounds but none are great. Ideally, this modal route is an actual, true self-standing route.
A similar discussion exists. It mentions parallel routes, but that as well wouldn't be suitable here. I'm trying to build a modal reachable from anywhere. The route has no relation to the previous page whatsoever.
I can't imagine that this is uncommon, yet I haven't found a solution for it.
I don't think it's possible to keep the previous route from unmounting during navigation, and I don't think it's possible to (re)render the previous route (or any arbitrary route) while actually on another route.
Beta Was this translation helpful? Give feedback.
All reactions