reactjs / react-transition-group

An easy way to perform animations when a React component enters or leaves the DOM
https://reactcommunity.org/react-transition-group/
Other
10.1k stars 652 forks source link

React Transition Group/ with React Router example to be updated with React Router v.6 #835

Open PoliGanina opened 2 years ago

PoliGanina commented 2 years ago

What is the current behavior?

The given example on page of React Transition Group [https://reactcommunity.org/react-transition-group/with-react-router] is based on previous version of React Router. When I use the code from example, even with Router v.6 updates, there is a bug, the animation of transition doesn't work. It works like a regular router.

What is the expected behavior?

the animated transition should appear

Could you provide a CodeSandbox demo reproducing the bug?

CodeSanbox demo https://codesandbox.io/s/romantic-brook-z5zujp?file=/src/index.js

Nantris commented 1 year ago

The React Router example is also not functional in React StrictMode. It's advised on other issues to use nodeRef to avoid findDOMNode but it doesn't work when you follow the advice at https://reactcommunity.org/react-transition-group/with-react-router.

I think that page really could use an update!


By the way @PoliGanina your link somehow doesn't lead where you'd think - but here's a fixed version: https://codesandbox.io/s/romantic-brook-z5zujp?file=/src/index.js