Content will be updated
This page was moved from the old website without any change and might be updated
@OnCreateTransition methods to take
@State arguments if the Transition definition should take value of the state into account.
In order to make this happen, the framework needs to postpone collection of
MountState (always on UI thread), while normally this would be done on
LayoutState (which may be processed on a background thread).
Diff<T> and @State
If your transitions should depend not only on the actual (updated) value of a
@Prop or a
@State, but rather ont the value change, you could use a generic Diff for arguments, so you get access to both previous and next
Here's how we could change one of our samples to only animate expanding, but not collapsing.
To define transitions that should run conditionally under certain circumstances, you can use
It works as regular
@OnUpdateState methods, but also returns
Transition that should be run whenever the method was invoked.
Another implementation for the above sample using
@OnUpdateStateWithTransition may look like this: