Find the best state management library for your React Native app with this comparison of the React Context API, Hookstate, and Easy-Peasy.
If you’ve had to work on an application where more than two components with different ancestry had to share the same state, you understand that passing props to all these components can get messy fast. State management is a way to manage this data across our app, from the value of a text field to the rows on a table.
Enter state management libraries, like Redux. These libraries aimed to solve this problem, but they still weren’t perfect. The truth is, the perfect state management library does not exist. There are too many different factors to consider when choosing one, like the size of your app, what you want to achieve, and how much state is shared.
In this article, we’ll be looking at some state management options to help you make a decision on which to use in your React Native apps. I will compare the developer experience of state management with the React Context API, Hookstate, and Easy-Peasy.
There are so many articles already written about popular state managers like Redux, so I will be discussing these smaller ones to help you make an informed decision.
In order to follow along with this article, you should have the following:
I will be using Yarn for this article, but if you prefer npm, be sure to replace the commands with the npm equivalents.