Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Navigation vs. React Native Navigation [closed]

What are the technical differences between the main two React Native navigation solutions: React Native Navigation and React Native?

Are there specific technical limitations that would require the use of one over the other?

Is one more widely used than the other?

like image 381
Edwin Vargas Avatar asked May 24 '17 02:05

Edwin Vargas


People also ask

What is the difference between React navigation stack and react navigation stack?

A key difference between how this works in a web browser and in React Navigation is that React Navigation's native stack navigator provides the gestures and animations that you would expect on Android and iOS when navigating between routes in the stack.

Is react navigation only for React Native?

React Navigation is a standalone library that enables you to implement navigation functionality in a React Native application. React Navigation is written in JavaScript and does not directly use the native navigation APIs on iOS and Android.

What is the difference between React navigation 5 and 6?

React Navigation 6 keeps the same API as React Navigation 5, however there are some breaking changes to make the API more consistent, more flexible and less confusing. This guide lists all the changes and new features that you need to keep in mind when upgrading.


2 Answers

NEW EDIT: As of today (07/2020) I suggest using React Navigation v5. It's the community solution being most pushed by Facebook. The V5 rewrite was a complete game changer and is far superior to previous versions. Easy to get setup and implementing easy/complicated stacks is a breeze most of the time.

If that's not doing it for you another alternative is react-native-navigation by WIX (not compatible with expo unfortunately).


React Native Navigation as the name says uses the native modules with a JS bridge, so performance will/may be better. This requires native integration.

While React Navigation is a simple and powerful solution provided by react native itself. Its an all JS implementation unlike the other that uses native support which can be tricky. Just npm-install and you're good to go ...

Use react navigation if you prefer an all JS implementation and use native navigation if your highest priority lies in performance .

  • Both libs have undergone drastic changes and entered next stable versions. react-navigation is more stable and performant now. If you have to handle complex computations in js go for react-native-navigation. but in most cases react-navigation will work for you!
  • With the advent of react-native-screens, the native screen optimisation is brought possible to react-navigation by bringing the native navigation component (UIViewController for iOS, and FragmentActivity for Android) Refer here

For those who are looking from a user experience view, both provides almost identical animations and flow so that you wouldn't know what lib is used behind the scenes. The major difference is the native side that can make performance better(which is crucial for a better user experience)

Both libs are amongst the best navigation solutions for React Native. Use it according to your need/preference.

like image 157
Victor Avatar answered Oct 06 '22 06:10

Victor


React Native Navigation using native navigation by wrapping each screen with a native controller. So the performance is optimized by the native realm. The area you gonna implement is inside the header and tab bar.

React Navigation is pure js implementation. It uses React-native root view as the container view. Each screen is under the root view hierarchical tree.

So if you open the app from View Hierarchy console, you will see a big difference (React Navigation includes a bunch of weird components like multiple headers or tab bar, the tree is also difficult to understand).

like image 20
Maolei Tang Avatar answered Oct 06 '22 05:10

Maolei Tang