You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typically if i want to animate e.g. a dialog open/close state (passed item to useTransition is of type boolean) i only use from, enter and exit. Here's how i understand how they behave:
from: "starting state" of the animation. Get applied once the item changes to true
enter: "idle state" of the animation. These indicate the desired props and are animated from from
exit: "exit state" of the animation. Animated to from enter if item changes from true to false. After reaching the animation finished, the component gets unmounted
But what is the use case for the initial and update props? If i use initial (next to from, enter and exit) nothing changes
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
useTransitionhas a range of props as shown in the documentation (from https://www.react-spring.dev/docs/components/use-transition#reference):Typically if i want to animate e.g. a dialog open/close state (passed item to
useTransitionis of typeboolean) i only usefrom,enterandexit. Here's how i understand how they behave:from: "starting state" of the animation. Get applied once the item changes totrueenter: "idle state" of the animation. These indicate the desired props and are animated fromfromexit: "exit state" of the animation. Animated to fromenterif item changes fromtruetofalse. After reaching the animation finished, the component gets unmountedBut what is the use case for the
initialandupdateprops? If i useinitial(next tofrom,enterandexit) nothing changesBeta Was this translation helpful? Give feedback.
All reactions