Skip to content

Commit

Permalink
Updated navigation-compose-component.md
Browse files Browse the repository at this point in the history
  • Loading branch information
arkivanov committed Feb 11, 2024
1 parent 551324a commit 802c27a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/tips-tricks/navigation-compose-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This section may be useful when migrating from the official [navigation-compose](https://developer.android.com/jetpack/compose/navigation) library to Decompose. We can convert screens to Decompose gradually (one by one), keeping the navigation untouched until every screen is converted. This section describes how we can host a Decompose component (or a tree of components) in a `Composable` screen managed by `navigation-compose` library.

!!!note

This section implies minimum Decompose version `3.0.0-alpha06`.

!!!warning

The `navigation-compose` library provides only two scopes for a screen: the `Composable` function of the scren and the `ViewModel` scope. There is no such a scope that is also destroyed on configuration change. So the only scope where we can host Decompose components is the `ViewModel` scope. This means we should take extra care to not leak any objects (e.g. don't pass `NavController` into component).
Expand Down

0 comments on commit 802c27a

Please sign in to comment.