src/index.js
/**
 * Square components are function components.
 *
 * Function components:
 * -> only contain a render() method
 * -> don't have their own state
 */
Square components are function components.
Function components:
-> only contain a render() method
-> don't have their own state
Square components are function components . Function components : - > only contain a render () method - > don ' t have their own state
function Square(props) {
  return (
    <button className="square column" onClick={props.onClick}>
      {props.value}
    </button>
  );
}
function Square ( props ) { return ( < button className = "square column" onClick = { props . onClick } > { props . value } < / button > ) ; }
Square components are function components.
Square components are function components .
/**
   * When a square is clicked, the onClick function in Board is called.
   * -> onClick tells React to set up a click event listener
   * -> when the button is clicked, the onClick event handler is called
   * -> this event handler calls props.onClick (the onClick prop was specified by the Board)
   */