Member-only story
Why Using Navigation-Compose in Your Jetpack Compose App is a Bad Idea
Know the pitfalls of Navigation Compose
If you’re reading this article, you’re probably thinking:
“Hmm, I wonder what to use to navigate in my Jetpack Compose app. Should I use navigation-compose as suggested by Google or stick with Fragments and use Compose only for rendering views?”
In this article, I’m going to talk about my experience with both Navigation-Compose and Fragments in a Jetpack Compose app. You will learn which approach is better (in my opinion) and what obstacles may await you by using each of them.
Let’s start
If you Google “Jetpack Compose Navigation” you will probably see the Navigation-Compose library as one of the first results. Google describes it as a new navigation component that supports apps written in Compose and claims that “thanks to it we can navigate between composables while taking advantage of the Navigation component’s infrastructure and features.”
Sounds perfect, but is it? We should talk about what the new navigation looks like…
Google really wanted to create a Framework that would be able to manage lifecycles, navigation and everything around it while eliminating the need to use Fragments. They came up…