Please view this on a desktop
Remember when we discussed that
state is managed inside a component, and it flows down to its child components via props
Generally, you'll have sibling components that need to reflect the same changing data, and in React we usually "lift the state up" to their common parent.
But how do we change state of a parent component from a child component?
Let's take Airbnb for example:
Parent component: main/home page <—— state is here
Child component: House with a Like button <—— when we click this...
Child component: Liked Properties <—— ...this should be updated
To make data flow up, i.e to have a child component affect the state of it's parent or any ancestor,
"Function props" are props that happen to be functions 🤷🏽♂️
So far, we have been passing primitives and objects as props, like this: