This React project demonstrates how to pass data from a parent component to a child component and how to update the parent component's state from the child component.
- The parent component
App
has a state object with a propertychildName
and the functionreceiveName
to call the set state method. - The parent component
App
passes the functionreceiveName
to the child componentChildComp
. ChildComp
sets thechildName
property by calling thereceiveName
function.