I'm using React router for a project. I would like to animate a single route, which lives inside a parent route (basically, a single project will appear as a "modal" on top of the list of projects, so the content of the parent route need to persist when the child route is visible.
The routing works fine now, but the struggle comes when animating. I remember seeing an example at some point where a sidenav was being animated in as a route, but I can't find it anywhere now...
Example code: https://codesandbox.io/s/1447zpvlzj
Current behavior: I'm following the example on the react router tutorial When adding the key to the like in the example, the application breaks on route change. When the key is removed, the route changes, but the transition doesn't happen (enter and exit classes are not added to the route).
I also tried wrapping the route in a div instead of the Switch. This actually gave me a proper transition on enter. However, the on exit transition would break because the route content (the content inside the wrapper div) would actually disappear before the exit transition timeout was finished