Modal Routing (Rendering on top of current route) #8129
christianblandford
started this conversation in
Proposals
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.
-
Hi all,
I have been attempting to modify the source of react-router and react-router-dom to allow for modal routing. Basically, if I go to a certain route, I would like a modal to automatically open on top of whatever the parent route was. Doing it this way allows for forward/back buttons to work as intended, and to have modals on any given route, rendering on top when possible.
I noticed that the source code explicitly mentions to share the use case if having to use the unsafe exports in the source code. I figured I'd share this with the team before I fork the project and go crazy. I have also attempted to use portals to do this, but haven't been able to make this work properly with v6.
Is there anything like this in the works?
Example: My app has projects and processes. Projects can contain multiple processes, however, processes can also be created without a parent project.
/projects/1 renders the project route for project ID 1.
/projects/1/add-process would render the process creator modal on top of project 1.
/processes/add-process would also render the comment editor, on top of the processes list.
/processes/add-process/step2 would render step 2 of the process creation wizard on top of the processes list.
Would be awesome to be able to define routes like /*/add-process/:page , which would render the add comment modal on top of whatever the current route is.
Beta Was this translation helpful? Give feedback.
All reactions