DEV Community

Discussion on: Driving Towards a Universal Navigation Strategy in React

Collapse
 
satya164 profile image
Satyajit Sahoo • Edited

I think the difference is "routing" libraries vs "navigation" libraries. I agree, the routing library should not provide any UI.

But in case of React Native, where we are building apps which usually need to match the native experience provided by native apps, it's also wasteful to redo these for every app. In a lot of cases, you "do not" need ultimate control over how navbars and other components render, but want to provide a native experience to the user and have ability to customize the UI enough to match your design. That's what a navigation library aims to achieve.

React Navigation is essentially an ecosystem, not a single library. The @react-navigation/core package provides the core logic and is equivalent to a routing library when combined with @react-navigation/routers. Then there are integrations such as @react-navigation/stack, @react-navigation/bottom-tabs etc. which provide UIs on top of this router logic to make app development easier.

You can always build these things yourself, but if you want to provide a native experience, it's not that trivial. You need to deal with complex animations and gestures etc (look at the header animation on iOS). I have built these things, they take a lot of time.

Sure, on web it works. You can build a great web app with just a router. But people rarely have gestures and animations in web apps. Native apps have a higher standard when it comes to animations and gestures, which makes it much more work.