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
-
useTransition
has 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
useTransition
is of typeboolean
) i only usefrom
,enter
andexit
. Here's how i understand how they behave:from
: "starting state" of the animation. Get applied once the item changes totrue
enter
: "idle state" of the animation. These indicate the desired props and are animated fromfrom
exit
: "exit state" of the animation. Animated to fromenter
if item changes fromtrue
tofalse
. After reaching the animation finished, the component gets unmountedBut what is the use case for the
initial
andupdate
props? If i useinitial
(next tofrom
,enter
andexit
) nothing changesBeta Was this translation helpful? Give feedback.
All reactions