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.