Skip to content

Commit

Permalink
Merge pull request #732 from arkivanov/update-docs-duplicate-configs
Browse files Browse the repository at this point in the history
Updated docs for Duplicate Configurations feature
  • Loading branch information
arkivanov authored Jul 1, 2024
2 parents ce4d007 + 640b3a9 commit 6f24983
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion docs/navigation/children/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
10 changes: 10 additions & 0 deletions docs/navigation/pages/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
10 changes: 10 additions & 0 deletions docs/navigation/stack/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down

0 comments on commit 6f24983

Please sign in to comment.