Skip to content

Commit

Permalink
Use key for visibleTransition
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-udy committed Sep 16, 2024
1 parent 206ac3d commit 111be63
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.NonSkippableComposable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
Expand Down Expand Up @@ -98,9 +99,11 @@ internal class ComposableDestinationAnimations(
currentAnimationEvent = AnimationEvent.SnapTo(event.visible)
}
}

val visibleTransition = key(instruction.instructionId) {
rememberTransition(visibilityState, "ComposableDestination Visibility")
}
animation.Animate(
visible = rememberTransition(visibilityState, "ComposableDestination Visibility"),
visible = visibleTransition,
) {
enterExitTransition = it
content()
Expand Down

0 comments on commit 111be63

Please sign in to comment.