What is "lifting state up"?
Model answer
When two components need the same data, move the state to their closest common parent and pass it down as props, along with functions to change it. For example, a search box and a results list both need the search text, so the parent keeps it.
It keeps one source of truth. If it leads to passing props through many levels, consider Context or a store.
Learn this topic
React useState Explained: Make Your Page React to Change in the course React.js Full Course: Beginner to Advanced.
Sign in to add your own answer.