Skip to content

useTransition rework #17

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

Closed
wants to merge 30 commits into from
Closed

useTransition rework #17

wants to merge 30 commits into from

Conversation

aleclarson
Copy link
Contributor

@aleclarson aleclarson commented Jul 10, 2019

Sister PR to pmndrs/react-spring#750

Ideas

These demos would be nice to have:

  • Stress test for reordering/filtering lists

Todo

  • These demos don't use the new API yet:
    • freshtilledsoil demo
    • issue-related demos
  • Click fast on the simple-transition demo, and notice a bug. (Not sure if we can fix this bug, but maybe we rearchitect the example?)
  • The image-fade demo seems broken
  • Make list-reordering demo look better in small container

Done

  • These demos are using the new API:
    • masonry-grid demo
    • multistage-transitions demo
    • simple-transition demo
    • notification-hub demo
    • chain-animation demo
    • image-fade demo
      • Images whose "leave" animations have finished are dismounted when the next image enters
    • list-reordering demo
      • Avoid passing new objects on every render
      • Switched to vertical layout (we can reduce the number of items to make it look good in small container)

@aleclarson aleclarson mentioned this pull request Sep 18, 2019
8 tasks
In v8, the default behavior of "useTransition" was to never reuse elements, which means new elements were created for every transition, even if a leaving element has the same key.

In v9, the "unique" option was removed and "unique: true" is the default behavior. To emulate "unique: false" in v9, you need to provide a new key for every transition, and then have some way to derive the correct element based off that key. In the "simple-transition" demo, that is pretty easy, since we just increment the "index" on every transition and use modulo to determine which element should be rendered.
@aleclarson aleclarson closed this May 7, 2020
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.

2 participants