I'm really struggling to implement something in React Router Version 6, that was relatively straight-forward in Version 5.
I'd like to not only animate between routes (which is now finally possible in Version 6 due to a recent commit to the library), but also to animate nested routes. Think sliding pages, within sliding pages.
Here is a CodeSandbox with what I have so far.
I'm using Framer Motion's AnimatePresence to detect exit animations. But React Router wants to re-animate the parent route, even if just the nested route has changed.
As you can see in the CodeSandbox demo, the routes are animating okay, but when clicking the "Next nested page" link, it also re-animates the whole page, which is not what's desired. What I'd like is for Page 1 to stay static while its' nested route animates. Obviously, when you click "Next page", the whole page should animate (moving from Page 1 to Page 2). But I can't seem to have my cake and eat it.
Has anyone been able to do this? Grumblings in the library and on the wider web are indicating that this may be impossible currently?
