kha*_*iuk 2 javascript reactjs
我有两个组成部分:Cell和Screen。Cell旨在成为屏幕的孩子,我将像这样使用它们:
<Screen>
<Cell x={1} y={2}/>
<Cell x={1} y={1}/>
</Screen>
Run Code Online (Sandbox Code Playgroud)
问题:我怎样才能x和y道具里面Screen的render方法?像这样:
render() {
var {children} = this.props
children[0].x // it doesn't work
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4089 次 |
| 最近记录: |