Grokking React Advanced
0% completed
Understanding Redux
Where should a piece of state live when components in distant parts of the tree all need to read it and change it? React Fundamentals gave two answers. You can lift the state to a common parent and pass it down as props, or you can put it in a context so that any component below the provider can read it. Chapter 1 of this course took the context answer further.
Redux gives a third answer. It keeps the shared state outside the React tree, in one JavaScript object held by an object called the store. Components do not change that object directly
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%