🎉 Black Friday Sale! Save 30% when you subscribe today.

Pros and cons of tree-based vs stack-based navigation

Episode Clip • Feb 9, 2023

In this clip from our livestream we discuss the pros and cons of tree-based and stack-based navigation. For tree-based navigation:

  • Pros:

    • Concise way of describing navigation

    • Can describe the finite number of paths in your app

    • Feature modules are fully self-contained

    • Easy to test integration

    • Unifies all types of navigation APIs

  • Cons:

    • Can’t express complex or recursive navigation paths

    • Couples destinations together

    • Still very buggy in iOS 16

For stack-based navigation:

  • Pros:

    • Can handle complex and recursive navigation paths

    • Each screen in the stack can be fully decoupled from the other screens in the stack

    • Way fewer bugs in the iOS 16 APIs

  • Cons

    • It is not concise and allows for potentially non-sensical navigation paths.

    • Feature modules become mostly inert when run in isolation since they cannot navigate anywhere else.

    • It is more difficult to integrate features together and test.

Get started with our free plan

Our free plan includes 1 subscriber-only episode of your choice, access to 64 free episodes with transcripts and code samples, and weekly updates from our newsletter.

View plans and pricing