react 数据传递 (一)
class Board extends React.Component { renderSquare(i) { return <Square value={i} />; } }
class Square extends React.Component { render() { return ( <button className="square"> {this.props.value} </button> ); } }
Board组件引用了Square组件;
父组件Boaed通过属性名={参数},传递
子组件通过{this.props.属性名}接收