I've been searching through documentation and I could not find a confirmation. Does anyone know if the navigation
and compose
component from Android Jetpack
are compatible with each other?
I know that Jetpack Compose
is not production ready and is only in developer preview mode, however I am testing with it and cannot seem to configure my project to work with both of these jetpack components.
Any information would be highly appreciated.
Long-term, there will be first-class support in the Navigation component for Jetpack Compose. Google has indicated this on several occasions, mostly in the Kotlinlang Slack #compose
channel.
Right now (30 June 2020), Navigation knows nothing about Compose. Eventually, my guess is that the Navigation DSL will support referencing composables (or lambdas that update states), but that is just a guess.
If you want to use both today, one option would be to continue using fragments:
Later, when Navigation directly supports Compose, you could "unwind" those fragments and do everything directly in Compose+Navigation.
Alternatively, there are non-Navigation routing options available from third parties (though, like Compose, they are all fairly new).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With