-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Disable initial transition #223
Comments
For now this would work:
I’ll add a flag or something to make this easier, any ideas? Btw, does this mean react-motion can’t animate initial elements? Would be nice to allow both without too much hassle. |
As of 5.7.0 you have an additional prop I'm in the process of documenting it all, here's a temporary version listing all the current props: http://steady-impulse.surge.sh/transition You can already try it in the live playground there, add initial={null} and it won't animate. |
Great news! I'll try this out soon and report if I meet any issues. |
Hi. I'm new to react-spring, but have a background in react-motion. My main goal while using this library was to make the code simpler and more readable, which I believe was one of the goals of this library in comparison with react-motion.
However, while migration from TransitionMotion to Transition, I've faced a problem, where I couldn't disable the animation for the first mount. In react-motion
willEnter
applies only to the new elements, not the initial ones, which makes me able to render the children for the first time without the animation.However, when I try to move to react-spring's
Transition
, it appliesfrom
styles to the first children and animates the as if they have just entered.This probably would be okay if it wouldn't produce performance issues. E.g. when I navigate to the page with my Components with transition, animation freezes for a moment, even when using
native
andanimated
.So my question is - is it possible to disable the initial animation for components rendered via
Transition
, so that it only animates the entering/leaving nodes after the first mount.The text was updated successfully, but these errors were encountered: