|
|
|
|
|
by borplk
3296 days ago
|
|
Redux state is useful for when other parts of the app need to be aware of or react to that state. Sometimes there are little bits and pieces that may look like they are "private state of a component" but over time you'll find instances where it's useful to know that state. For example I have a LoginForm component and a SignupForm component. If you have half-way filled email and password on the LoginForm, but click on "Create an account" it would be nice if SignupForm picked up that state from the login form. So my LoginForm state is stored in the redux store under the key "loginForm". And SignupForm will pick up that state if available and vice-versa for going from sign up to log in. |
|
I've been doing some React projects for the past 6-7 months and I still haven't had the need to use Redux. I believe you want Redux when your application is really large / complex.