More React Concepts

Learn React's unidirectional data flow and hooks vs. classes.

Unidirectional data flow

Property values generally get created at one level of our component tree and get passed down as far as they need, to get to where they are required. These properties or props are frequently the value of a state variable that gets passed down to a lower-level component, or it might be a function pointer that acts upon the state at one level but needs to be called by a lower-level component. If we need to use a state value in a different branch of our tree structure, we’ll likely need to move management of that state up to a common component between those two branches and then pass the value back down to both places. This method is a typical development pattern in React and is called “lifting state.”

Get hands-on with 1200+ tech skills courses.