Why gets event handler passed from parent to child component?


does anyone know the exact reason, why the event handler function has been defined inside the parent component and not inside the child (button) component?
Is the reason to keep all event handler functions in one place (the parent)?

<Below this line, add a link to the EXACT exercise that you are stuck at.>


yes, code structure/organization, one class to handle the logic and one class to handle the presentation.

its nicely explained here:

and i believe as well somewhere in part 1 or part 2 of the React course


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.