Why should you use Redux?

if you have any experience in React Native App Development, and data flow structure in React with props, then you know that data is passed down the component tree via props and for data to come back up the tree, they have to be connected between each component in the tree. I know right that sounds overwhelming, and yeah it is, think how much complex your app will get if you just pass props everywhere and make callbacks to pass data parent class in the tree, and all this would result in a complex code structure resulting in a big mess, which of course is going to be a headache for someone(or yourself after a long break) else to even comprehend the data flow of the app.

Misconception?

The biggest misconception in React Native is that Redux solves “state management”, No, React already does state management. Redux does help manage state, but that’s not the problem it solves.

Redux can help you in many ways, first and foremost, the reusability of data all around the app, like literally, you can use the same data on any page you want.

Situations in which you can add redux to your app!

Redux should be considered only when you have a heavy duty app, where network usage is high because you are requesting same data for multiple pages instead of reusing the old data, and also optimization is a big deal to you.

If you have a component structure where props are being forwarded down the app layers, consider using Redux.

– Caching with redux!

For example, loading a profile page once, and saving the session data in redux, and reusing the data again when user open the profile page instead of re-fetching it from the server.

Note: Choose Redux wisely it can fire back if not used correctly in a systematic manner, only use it if it is necessary, and where it helps you the most.