Skip to content
Discussion options

You must be logged in to vote

You will have a component that will be repeated in index, and all [...routes], what you are calling your "main screen" component.

Just duplicate that within [...routes].js file. Additionally, render a Modal component in [...routes].js with a useState controlled "open" (or whatever) parameter initialized to true. That way you can still toggle it closed (or navigate away...animating this might be tricky. Close, then navigate perhaps) but it will render initially in the open state. Your desired solution is easier than the examples you've seen trying to achieve a hybrid approach.

edit: although instead of toggling it closed, probably you just want to navigate away from route

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@MarianoArg
Comment options

Comment options

You must be logged in to vote
1 reply
@MarianoArg
Comment options

Answer selected by MarianoArg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants