Asked by: Gergina Braceras
Asked in category: technology and computing, programming languages, technology and computing, programming languages
Last Updated: 6th Jul 2024

Should you use Redux with react?

Redux, in its own words, is a predictable state container that JavaScript applications can use. It's most commonly used with React but it can also be used with any other JavaScript library or framework. It is lightweight at just 2KB (including dependencies), so it won't make your application's assets larger.



Redux is not recommended for this reason.

If you find yourself in any of these situations, Redux is probably not necessary for you. Redux is already used by your friends (or coworkers if you aren't really friends) to share and arrange state between components. You are still learning about React or any other framework.

You may also wonder if react can be used without redux. Redux is not required for React State Management. Redux also offers features such as store, reducers and actions, and methods like connect, mapStateToProps. mapDispatchToProps. and bindActionsCreator. This allows you to create and manage complex applications easily.

This is why Redux is so important.

Redux:

  1. A single piece of application state must be mapped to multiple containers components.
  2. Global components that are accessible from anywhere.
  3. Too many props are being sent through multiple hierarchies of parts.
  4. SetState is not a good way to manage state.
  5. Caching page state.

Is Redux overkill?

Redux is too complex to manage everything. It could have performance implications, it may increase the complexity of your app, make refactoring difficult, and likely reduce the reuse of many components.