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.18k stars 649 forks source link

React transition group still works without adding refs #870

Open wisteria-hill-technologies opened 2 years ago

wisteria-hill-technologies commented 2 years ago

What is the current behavior? I am trying to use react transition group with css transition, and not sure what is the point of creating and adding refs, as it seems to work without refs.

What is the expected behavior? It will not work without refs.

Could you provide a CodeSandbox demo reproducing the bug? this is original one with refs. http://reactcommunity.org/react-transition-group/transition-group Below is the one I removed refs. It still works. https://codesandbox.io/s/priceless-lovelace-zku7cm I removed all the refs from the example in the website, and it still seems to work.

Please let me know if refs are really needed to use transition group and css transition.

wisteria-hill-technologies commented 2 years ago

ok, sorry I found it in your documentation. http://reactcommunity.org/react-transition-group/transition#Transition-prop-nodeRef As far as I understand, in strict mode of react for development, I need to use refs. But, I am not using strict mode for my project. So, I don't need to use refs then. Thanks