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

toggle reverse on useTransitions #1896

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Supersteve128
Copy link

@Supersteve128 Supersteve128 commented May 19, 2022

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

  • Documentation updated
  • Demo added
  • Ready to be merged

This is an attempt to solve https://github.com/pmndrs/react-spring/issues/1794

@vercel
Copy link

vercel bot commented May 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-spring-io ✅ Ready (Inspect) Visit Preview Jul 18, 2022 at 10:02PM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 19, 2022

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:

Sandbox Source
spring-animating-auto Configuration
spring-card Configuration
spring-cards-stack Configuration
spring-chain Configuration
spring-css-keyframes Configuration
spring-image-fade Configuration

Copy link
Member

@joshuaellis joshuaellis left a 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.

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

Successfully merging this pull request may close these issues.

None yet

3 participants