Member-only story

Why Using Navigation-Compose in Your Jetpack Compose App is a Bad Idea

Know the pitfalls of Navigation Compose

Patryk Kosieradzki
Better Programming

Photo by Markus Winkler on Unsplash

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…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (10)

Write a response

This is not the first post I read about the navigation component and Jetpack compose, but it is the first that actually recommends going back to fragments. I think that would be a great mistake. if you see compose as the way forward, then why would…

I highly recommend checking this library out, it feels like what Google should have given us to begin with https://github.com/raamcosta/compose-destinations

I wholeheartedly agree with the article. Navigation-Compose's API was a direct copy of Flutter Navigator 1.0, and has inherited the typelessness of the Javascript world - runtime crashes for the simplest things. Manual conversion to base64 and back…

Recommended from Medium

Lists

See more recommendations