合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
``` class Board extends React.Component { constructor(){ super(); this.state = { squares: Array(9).fill(0) } } handleClick(i){ console.log(i); } renderSquare(i){ return ( <Square value={this.state.squares[i]} onClick={()=> this.handleClick(i) } /> ) } ``` false ``` class Square extends React.Component { render(){ return( <div> <button>{this.props.value}</button> </div> ) } } ``` true ``` class Square extends React.Component { render(){ return( <div> <button onClick={()=>this.props.onClick() }>{this.props.value}</button> </div> ) } } ```