-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
[FEATURE] Defining transitions between props #1725
Comments
initialTransition
Amazing post! Thanks for help thinking this through. On Ideally we'd add as little API as possible to achieve our aims and I think just this would be enough, vs There's also the added wrinkle of prop names/gestures vs variants. Prop names, useful with or without variants <motion.div
animate={{
scale: 1,
transitionFrom: {
whileHover: { duration: 1 }
}
}}
whileHover={{
scale: 2
}}
/> Or from variant names, only useful with variants <motion.div
variants={{
enter: /** **/,
exit: {
transitionFrom: {
enter: { duration: 1 }
}
}
}}
whileHover={{
scale: 2
}}
/> Supporting both might be quite difficult though I'll take a look into this as I can see the use of both. |
Makes total sense to try to add as small changes to the API as possible, and you're totally correct it gets more complicated than I outlined when opening the whole
Would be wonderful to see |
Hey @mattgperry, just hit this problem again, and saw you have been working on this, but closed #2332 a couple weeks ago. Did you find a blocker that prevents us from implementing Let me know if not and you think I should give it a shot. Edit: Is it revived here? #2643 |
There's a bit of a blind spot in the API at the moment where if you take
For instance you can see that when we re-enter the
animate
state there'll be adelay
applied. When really thedelay
naturally applies to the initial animation.It'd be good if we could figure out a way to define a transition that applies just on the initial animation. Perhaps there's also value in being able to define specific transitions more generally, like
whileHover
->animate
?Or
The text was updated successfully, but these errors were encountered: