大家好,感谢您的时间。通过{this.state} {this.props.children}
我看到一个教程与lynda.com React.js。 但是,它使用了旧版本的React。 他的代码:
render: function(){
return (
<div>
<Header title={this.state.title} status={this.state.status}/>
<RouteHandler {...this.state} />
</div>
)
}
但我使用的新版本15.2.1做出反应和应对路由器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>
)
}
谢谢大家
的可能的复制[阵营路由器和this.props.children - 如何通过状态this.props.children(http://stackoverflow.com/questions/35835670/react -router-and-this-props-children-how-to-pass-state-to-this-props-children) – azium
你可以在JSFddle或codepen中发布一个包含你的代码的链接。从上面的例子很难理解。 –