Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React transition group still works without adding refs #870

Open
wisteria-hill-technologies opened this issue Nov 19, 2022 · 1 comment
Open

Comments

@wisteria-hill-technologies
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant