-
I'm trying to create modal routes in remix. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Does it technically need to be a route? i.e. do you want to have your app's modal-state as part of your browser's history so that browser-back navigates back to an once opened modal? Do you need a deep-link that lets you link to that particular modal? Otherwise, have a look at implementations of the Dialog Design Pattern by e.g. Reach UI or Radix and use them as-is, without creating a new nested route. |
Beta Was this translation helpful? Give feedback.
-
I ran into this same issue of my route not animating on the way out. 001-modal-no-exit-transition.mp4Cross posting here for visibility; will update if find answer |
Beta Was this translation helpful? Give feedback.
-
Hey, I wrote a blog post about this. My version uses Framer Motion because that's what I use for animations across my project, but hey someone might find it useful. |
Beta Was this translation helpful? Give feedback.
@cliffordfajardo I came up with this:
Basically all the code for the modal is in the page page, then the outlet is in the modal code, this way, the open and close transition is handled from the parent page, you can then pass an onClose method to the modal page through context, onClose should navigate back to parent of course.