react怎么一次渲染多个组件

react怎么一次渲染多个组件


阿波罗的战车
浏览 709回答 1
1回答

大话西游666

1、把组件import进来import { MyComponent1 } from 'components/MyComponent1 'import { MyComponent2 } from 'components/MyComponent2 'import { MyComponent3 } from 'components/MyComponent3 '2、render方法调用组件render() {&nbsp; &nbsp; <div>&nbsp; &nbsp; &nbsp; &nbsp; <MyComponent1 />&nbsp; &nbsp; &nbsp; &nbsp; <MyComponent2&nbsp; />&nbsp; &nbsp; &nbsp; &nbsp; <MyComponent3 />&nbsp;&nbsp; &nbsp; </div>}
打开App,查看更多内容
随时随地看视频慕课网APP