什么是{this.props.children}?何时使用?

JavaScript

前端猿

2020-03-12

作为React世界的初学者,我想深入了解我使用时会发生{this.props.children}什么以及使用该情况的情况。下面的代码片段与它有什么关系?

render() {
  if (this.props.appLoaded) {
    return (
      <div>
        <Header
          appName={this.props.appName}
          currentUser={this.props.currentUser}
        />
        {this.props.children}
      </div>
    );
  }
}

第1253篇《什么是{this.props.children}?何时使用?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android