【发布时间】:2018-09-17 07:26:45
【问题描述】:
作为 React 世界的初学者,我想深入了解当我使用 {this.props.children} 时会发生什么,以及在什么情况下使用它。在下面的代码 sn-p 中它的相关性是什么?
render() {
if (this.props.appLoaded) {
return (
<div>
<Header
appName={this.props.appName}
currentUser={this.props.currentUser}
/>
{this.props.children}
</div>
);
}
}
【问题讨论】:
-
在给定的链接中不清楚当我在组件中使用 {this.props.children} 时会发生什么。
标签: javascript reactjs react-redux frontend