React Native Essential libraries

Lets explore some essential libraries use by RN developers.

5 min readNov 11, 2020

--

Photo by Guillaume Henrotte on Unsplash

React Native only come up with fundamental components with it such as View, Text, Button and etc. These components are not enough when the project or the app you are developing is becoming complex. Therefore we have to rely of third party libraries available for react native. The good news is that whatever the library you want there is a very high chance that it will be available for you to download thanks to the huge community passionate in RN. If you are new to React Native, this article will help you to explore some essential packages that you should know when becoming a RN developer.

1. react-navigation

copied from google

This library will be used to navigate via screens through out the application. React Navigation is easy to understand and easy to implement as well. It provides different navigators such as stack, drawer, tab and many more. Hooks and other functions are provided with this library to make the life of the developer easier. This library is updating often with new cool features. Check out the documentation here.

2. axios

Axios is used to make http requests from servers. It returns a promise and once the response is ready you can access and manipulate the result. In the same time you can handler errors regarding the http request inside the catch block.

axios.get('url')
.then((response) => {
// handle the response
}).catch((error) => {
//handle the error
})

React Native has fetch() method built in and it also can be used to make http requests. But developers tend to use axios over built in fetch() method because of several reasons. Check out the documentation here.

3. react-native-splash-screen

copied from react-native-splash-screen github repo

With this library you can add a splash screen for your react native application. Configuration steps are available based on the platform and the version of react native. To add a splash screen you should have little bit of native app development knowledge. Because the splash screen UI should be added natively (can’t use RN components or JS). Its not that hard after all since so many tutorials and articles are available for the developers to add a splash screen easily. Check out the documentation here.

4. react-native-vector-icons

copied from react-native-vector-icons github repo

This libraries contains so many icons created by different contributors. For an example it has MaterialIcons which is developed by Google, Feather by Cole Bemis & Contributors. You can check out vector-icons repo to find out what are the icon sets available and choose the suitable icons for you. Configuration steps are available for both the platforms before using this library. During the configurations you can add what are the icon sets you want. Don’t worry you can change the icon sets list whenever you want. Check out the documentation here.

5. react-native-svg

copied from google

This library will help to add different shapes of components to your application. This is highly used to make the UI more attractive for the user. Additionally svg components are used when it comes to animations. Check out the documentation here.

6. redux

redux mechanism copied from google

Redux is used for state management. What if you want to pass some data from one screen to another screen which not available near by. One way would be to pass as navigation params when navigating to each screen. This is not a good way since you are adding unnecessary code segments and making your life miserable. Instead, you can use redux to store those data from one screen and you can access those data from any other screen easily without passing data via screens. Note that this storage is volatile, once you restart your app previously stored data will be not available any more. Check out the documentation here.

7. react-native-async-storage

This library is used to store some data in device memory. It could be email address, password, token or etc. This storage is non-volatile. Don’t use this method to store everything(data that only need until the app is closed) you want to store because you are storing them in the device and it is a cost. Therefore as a solution you can use redux. Check out the documentation here.

8. prop-types

This library will help you to add data types of props which you are using in your custom components. It can be used in ReactJS as well. This library mostly used when publishing a new react/react native package to npm. This way you can show the developers what are the data types and required props for a particular component. It makes life easier of the developers to understand and use the component well. Check out the documentation here.

9. react-native-reanimated

When it comes to mobile apps development, user experience is very important. Therefore, animations will be a key area you should be familiar with to provide best user experience. React native already has built in Animated API support. But when it comes to gesture based animations this Animated API doesn’t give expected smooth animations. That is the reason of developing react-native-reanimated as they mentioned in their documentation. Using this library you can create cool animations easily. This library make sure that all the animations are running in UI thread and Javascript thread will be release for other work. This is the advantage of using react-native-reanimated because the animations will be very smooth even in low end devices. It provides so many methods and hooks within and at the beginning you will feel difficult to understand. But not to worry since there are plenty of tutorials available in Youtube to guide you. Check out the documentation here.

10. react-native-redash

This library contain so many helper functions for react-native-reanimated. So I recommend you to use this library if you are going to use react-native-reanimated. Documentation will help you to find out what are the functions available and how to use them. This library is rapidly updating and new features will be added frequently. Check out the documentation here.

All together we have discussed 10 essential libraries we should know as React Native developers. Hope this article will helpful for you to explore more in mobile development journey. There are so much more cool libraries available indeed. Search, explore, dig deep, find more and most importantly share. Thank you for reading!

--

--

Haritha Senevirathne
Haritha Senevirathne

No responses yet