This article walks you through 3 great libraries for navigation and routing in React Native mobile apps.
React Navigation
React Navigation is widely used, well documented and I personally like this one the most. It delivers out-of-the-box, pre-styling navigators such as Stack Navigator, Bottom Tab… You can also customize or extend any part of React Navigation to fit your needs.
React Native Navigation by Wix
React native navigation by Wix gives your React Native apps the real native feel. The Javascript APIs are simple and cross-platform. A big downside of this library is that it doesn’t work with Expo. If you are building a bare React Native app, it’s worth considering.
React Router Native
If you are a web developer or an ex web developer and familiar with both ReactJS and react-router-dom, then react-router-native is for you. This library is super easy to use and you can start building your app routing system in minutes without spending hours reading the docs like when using React Navigation or React Native Navigation by Wix.
react-router-native includes everything from react-router and adds a few APIs that are specific to React Native, including <NativeRouter> and a native version of <Link>.
Conclusion
We’ve covered the most popular navigating and routing open-source libraries for React Native. If you’d like to explore more new and fascinating things about modern mobile development, take a look at the following articles:
- How to Get the Window Width & Height in React Native
- Using AsyncStorage in React Native: CRUD Example
- How to render HTML content in React Native
- React Native: How to make rounded corners TextInput
- React Native: Make a Button with a Loading Indicator inside
You can also check our React topic page and React Native topic page for the latest tutorials and examples.