Component - Callback props
This React Native component shows how a parent passes a function (callback) to a child. The child calls this function when a button is pressed. This lets the parent know about the child's action and update its own state.
This React Native component shows how a parent passes a function (callback) to a child. The child calls this function when a button is pressed. This lets the parent know about the child's action and update its own state.
App ├─ View (container) │ ├─ Text (display message) │ └─ ChildButton (custom component) │ └─ Button (pressable)