rememberTransition
@Composable
Creates a Transition and puts it in the currentState of the provided transitionState. If the TransitionState.targetState changes, the Transition will change where it will animate to.
Remember: The provided transitionState needs to be remembered.
Compared to updateTransition that takes a targetState, this function supports a different initial state than the first targetState. Here is an example:
In most cases, it is recommended to reuse the same transitionState that is remembered, such that Transition preserves continuity when targetState is changed. However, in some rare cases it is more critical to immediately snap to a state change (e.g. in response to a user interaction). This can be achieved by creating a new transitionState: