Using Redux or Flux
When React applications begin to grow and get more complex, managing communication between components can become problematic. When using regular React, the way to communicate is to pass down values and callback functions as props to the child components. But this can be tedious if there are a lot of intermediary components that the callback must pass through. To address these state communication and management-related issues as the React application grows, people turn to using React with libraries and architecture patterns such as Redux and Flux.
It is outside the scope of this book to delve into the details of integrating React with the Redux library or the Flux architecture, but the reader may consider these options for their growing MERN applications while keeping the following in mind:
- Redux and Flux utilize patterns that enforce changing states in a React application from a central location. A trick to avoid using Redux or Flux in React applications of manageable...