Logo

Developer learning path

React

Three principles of Redux in React

Three principles of Redux

63

#description

Redux is a state management tool that is commonly used with React. It follows three core principles to manage the state of an application.

  1. Single Source of Truth: Redux maintains the entire state of the application in a single object called the Store. This helps to keep the application's state consistent, and also makes it easier to debug and test the code.
  1. State is read-only: The state object in Redux is immutable, which means that it cannot be changed directly in the application code. Instead, any updates to the state must be performed through a special function called a "reducer".
  1. Changes are made through pure functions: Reducers are pure functions that take the current state and an action object as arguments, and then return a new state object based on the action. Because reducers are pure functions, they are predictable and easy to test.

Overall, these principles help to simplify the management of complex application state, and make it easy to track down and fix any bugs that may arise.

March 25, 2023

If you don't quite understand a paragraph in the lecture, just click on it and you can ask questions about it.

If you don't understand the whole question, click on the buttons below to get a new version of the explanation, practical examples, or to critique the question itself.