Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why do I need redux in react native?

I am trying to find out why do I need redux if RN already have state, I can use state as I want as action or change something.

So why would I need it?

like image 569
user8026867 Avatar asked Mar 10 '23 01:03

user8026867


1 Answers

Redux provides a "shared state" that every component can access. For example, you may have found that a parent component needs to be aware of the state of a child component. You can resolve this in React alone by passing down a method as props to the child but this isn't a pattern you want to be repeating again and again, especially as your component structure becomes more complex and hierarchical. Redux provides an elegant solution. For small apps though, it's probably not necessary.

like image 78
Douglas Tyler Gordon Avatar answered Apr 01 '23 04:04

Douglas Tyler Gordon