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
toggle reverse on useTransitions #1896
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1d6f848:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you've gone for two approaches here, i'd prefer to go for the prop styled method as opposed to adding another argument to transition
.
I think reverse
would be better because this is in sync with the language we use in regards to loop
.
We should also add some tests for this new feature.
Why
It is not currently possible to reverse the order of the useTransition animation.
What
I changed the render transition function to allow an optional reverse prop and added the optional toggleReverse prop in the hook to change the transition ordering after every render.
Checklist
This is an attempt to solve https://github.com/pmndrs/react-spring/issues/1794