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

fix: add immediate to payload in useTransition hook #1600

Merged
merged 4 commits into from
Jul 6, 2021

Conversation

wyze
Copy link
Contributor

@wyze wyze commented Jun 29, 2021

Why

This change does fix #1581. I'm not sure if this is the right change though, given the comment above the code.

What

Add immediate back to the array of default props to allow useTransition({ immediate: true }) to be respected again.

Checklist

  • Demo added
  • Ready to be merged

Notes

If this is indeed a proper fix, I'd like to add a test somewhere. Any help with that would be great.

Sorry, something went wrong.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 29, 2021

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 02326bf:

Sandbox Source
spring-card Configuration
spring-goo-blobs Configuration
spring-flip-card Configuration
spring-slide Configuration
spring-draggable-list Configuration
spring-cards-stack Configuration
spring-viewpager Configuration
spring-simple-transition Configuration
spring-image-fade Configuration
spring-list-reordering Configuration
react-spring useTransition immediate bug Issue #1581

@joshuaellis
Copy link
Member

I'm not sure this should be added to default props... if you add immediate: true to the phases it works as intended. If we want it to work when passing in the regular transitionProps then we probably need to include it in payload

const payload: ControllerUpdate<UnknownProps> = {

@wyze
Copy link
Contributor Author

wyze commented Jun 30, 2021

Thanks for the direction! I've updated the code and added a test.

@wyze wyze changed the title fix: add immediate back to default_props array fix: add immediate to payload in useTransition hook Jun 30, 2021
@joshuaellis joshuaellis marked this pull request as ready for review July 1, 2021 07:51
@joshuaellis joshuaellis merged commit aac4ada into pmndrs:master Jul 6, 2021
@wyze wyze deleted the fix-usetransition-immediate branch July 6, 2021 16:56
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.

The immediate property no longer works with useTransition hook
2 participants