Something about React Redux:
Table of contents
No headings in the article.
Redux is a pattern and library for managing and updating application state, using events called “actions”. Redux gives us a store outside our dom to serve the data when we need it. React redux is the official React UI bindings layer for Redux. It gives us a redux store to dispatch actions from components.
It is used to prevent unnecessary re-rendering of components. It implements many performance optimizations internally so that the components re-render when it actually needs to. When we need to change a component by default the whole component is re-rendered but using redux it will render only the specific part that will need to render.
Here are some pros and cons of Redux.
Pros, Helpful for a large application Highly maintainable. Prevent re-renders of apps that increase performance. Makes debugging and testing easier.
Corns,
- Security issue: There is no encapsulation so any component can access any data so the change security issue grows.
- Excessive memory use: Redux is immutable so every time updates a state it returns a new state. In the long run, it may be expensive.
- Complex and time-consuming: For the small and medium state management need to write more code that is time-consuming. When using manipulations logic action or reducers Redux has an additional complexity in the layer.