Could someone explain please, why there is no exit...
# compose
d
Could someone explain please, why there is no exit animation for Snackbar? I have the following code:
Copy code
data class State(val snackMessage: String? = null) // hoisted in ViewModel

//show snackbars inside root Composable
LaunchedEffect(state.snackMessage) {
  if (state.snackMessage != null) {
    snackbarHostState.showSnackbar(state.snackMessage)
    viewModel.shackbarShown() // this make a copy of the state with snackMessage = null
  }
}
So then I emit a new instance of state with
snackMessage = null
, I expect that I see animation but instead it’s just gone. I’ve made some experiment and removed the line
viewModel.shackbarShown()
and then the exit animation was played…