【发布时间】:2016-11-19 02:09:05
【问题描述】:
大家好,感谢您的宝贵时间。
我看到了 lynda.com 的 React.js 教程。 但是,它使用了旧版本的 React。 他的代码:
render: function(){
return (
<div>
<Header title={this.state.title} status={this.state.status}/>
<RouteHandler {...this.state} />
</div>
)
}
但我使用的是新版本的 React 15.2.1 和 React-router 2.5.2。 而且我不知道如何通过 {...this.state} 与 {this.props.children}
render: function(){
return (
<div>
<Header title={this.state.title} status={this.state.status}/>
{this.props.children}
</div>
)
}
谢谢大家
【问题讨论】:
-
您能否在 JSFddle 或 codepen 中发布包含您的代码的链接。从上面的例子很难理解。
标签: javascript reactjs react-router