I am learning react with official documentation, there in the tutorial of the official page develop a small example of the game tic tac toe and I understand it but there is a line that causes me a lot of confusion. In the square component (which represents a table on the game board) a value is received by parameter to fill it in with the props , which is send from parent board .
My confusion is in square
is a button that makes use of the event onClick this is the code:
function Square(props) {
return (
<button
className="square"
onClick={ props.onClick} >
{props.value}
</button>
);'}'
What does this mean onClick={props.onClick}
? What function does it call? or what is the function of props.onClick ?