From 640b3a9eb0e623571676a7d7f1cc1425b1d3a6b1 Mon Sep 17 00:00:00 2001 From: Arkadii Ivanov Date: Mon, 1 Jul 2024 20:56:44 +0100 Subject: [PATCH] Updated docs for Duplicate Configurations feature --- docs/faq.md | 10 ++++++++++ docs/navigation/children/overview.md | 2 +- docs/navigation/pages/overview.md | 10 ++++++++++ docs/navigation/stack/overview.md | 10 ++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index cd96faef3..3dde466a3 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -36,3 +36,13 @@ This exception is thrown when duplicated component configurations are detected b - Prefer `pushNew` function instead of `push` when showing a component on a button click, it will properly handle accidental double clicks. - Prefer `pushToFront` to prevent duplicated components with the same data (configurations) in the stack. + +### The experimental Duplicate Configurations mode + +You can also try enabling the experimental Duplicate Configurations mode using the following flag: + +```kotlin +DecomposeExperimentFlags.duplicateConfigurationsEnabled = true +``` + +This will allow having duplicate configurations in all navigation models. Please keep in mind that this feature is experimental. diff --git a/docs/navigation/children/overview.md b/docs/navigation/children/overview.md index 98303ec00..761b0ea32 100644 --- a/docs/navigation/children/overview.md +++ b/docs/navigation/children/overview.md @@ -8,7 +8,7 @@ The navigation is performed by transforming the current `NavState` to a new one. ## ChildNavState -`ChildNavState` represents a state of a child component. It holds a `Configuration` that works as a key of the child component, and a `Status` that represents the required lifecycle status of the child component. As mentioned earlier, the `Configuration` must unique within the `NavState`. +`ChildNavState` represents a state of a child component. It holds a `Configuration` that works as a key of the child component, and a `Status` that represents the required lifecycle status of the child component. As mentioned earlier, the `Configuration` must be unique within the `NavState`, unless `DecomposeExperimentFlags.duplicateConfigurationsEnabled` flag is enabled. The `Status` can be one of the following: diff --git a/docs/navigation/pages/overview.md b/docs/navigation/pages/overview.md index 439be048e..df335ad85 100644 --- a/docs/navigation/pages/overview.md +++ b/docs/navigation/pages/overview.md @@ -29,6 +29,16 @@ Similarly to `Child Stack`, each component created and managed by the `Child Pag - Configurations must be unique (by equality) within `Child Pages`. +### The experimental Duplicate Configurations mode + +You can also try enabling the experimental Duplicate Configurations mode using the following flag: + +```kotlin +DecomposeExperimentFlags.duplicateConfigurationsEnabled = true +``` + +This will allow having duplicate configurations in all navigation models. Please keep in mind that this feature is experimental. + ### Initializing Child Pages There are three steps to initialize `Child Pages`: diff --git a/docs/navigation/stack/overview.md b/docs/navigation/stack/overview.md index b39ded010..9be26eab8 100644 --- a/docs/navigation/stack/overview.md +++ b/docs/navigation/stack/overview.md @@ -21,6 +21,16 @@ Each component created and managed by the `Child Stack` has a configuration, ple - Configurations must be unique (by equality) within the `Child Stack`. +### The experimental Duplicate Configurations mode + +You can also try enabling the experimental Duplicate Configurations mode using the following flag: + +```kotlin +DecomposeExperimentFlags.duplicateConfigurationsEnabled = true +``` + +This will allow having duplicate configurations in all navigation models. Please keep in mind that this feature is experimental. + ### Initializing the Child Stack There are three steps to initialize the `Child Stack`: