I know there are a few similar questions here and here but I am having a tough time understanding what is the correct thinking today on this and extrapolating it to my situa
call parent function from child
You don't (like what the other posts say). You pass handleScoreRemove
into the child as a prop. Inside the child, you call the function by calling the prop. In the following, handleScoreRemove
is passed as the onScoreRemove
prop inside the child.
You're already doing the same thing with the ScoreBox
(parent) and ScoreForm
(child). You're passing a reference of handleScoreSubmit
as onScoreSubmit
prop in the child.