From d7705ad395c5730f0be6005421eeed2c9d0f388d Mon Sep 17 00:00:00 2001 From: Gabriel Souza Date: Tue, 4 Jun 2024 20:24:26 -0300 Subject: [PATCH] Update transitions docs --- docs/transitions-api.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/transitions-api.md b/docs/transitions-api.md index 9e05530b..79c57e6c 100644 --- a/docs/transitions-api.md +++ b/docs/transitions-api.md @@ -13,7 +13,7 @@ setContent { } ``` -!!! error +!!! danger There is a know bug using any Transition APIs can leaky ScreenModels or ViewModels, this happens because Voyager by default dispose Screens in the next Composition tick after a `pop` or `replace` is called, but the transition only finish later, so the ScreenModel or ViewModel is re created or cleared to early. For this purpose since Voyager `1.1.0-beta02` we have introduce @@ -35,11 +35,10 @@ setContent { !!! warning Have encounter `Screen was used multiple times` crash? Provide a `uniqueScreenKey` for your Screens - ```kotlin hl_lines="3 4" + ```kotlin hl_lines="3 3" class ScreenFoo : Screen { - override val key: ScreenKey - get() = uniqueScreenKey + override val key: ScreenKey = uniqueScreenKey @Composable override fun Content() {