Create official React Router 6 example
Is your feature request related to a problem? Please describe. Framer motion almost works with the new React Router 6 but not quite. Its a bit stuttery and unpredicatable and I would love to hear some feedback on testing with latest features.
Describe the solution you'd like Very simple application to demonstrate nested routes with react router 6.
Describe alternatives you've considered React router 5 works a treat but Im already thinking about migration
Additional context In the codesandbox example the correct animations are applied, but there is some lag requiring extra clicks to flush through actions to the appropriate animations on the nested routes.
codesandbox https://codesandbox.io/s/react-router-v6-mfeqg?file=/src/Admin.js
I am using a key on the Routes object because location prop is not yet implemented which is appears to be the preferred route re-render mechanism using RR5.
If anyone wants to fork the sandbox and make corrections Im happy to help with testing and further examples.
thanks
+1 There are a lot of issues with React Router 6 and Framer Motion. I'm struggling to get it to work for the simplest use cases.
As far as I can understand the main problem stems from the new <Routes> component which unlike the old <Switch> doesn't take location as a prop. There is a PR to fix it already in react-router, i guess most of these issues will be fixed when that is merged.
For reference, this is the discussion in the react-router repository: https://github.com/ReactTraining/react-router/issues/7297
Router 6 users: How is this looking?
Official example: https://codesandbox.io/s/framer-motion-react-router-6-page-transitions-2f2olf?file=/src/template/Image.tsx