react怎么一次渲染多個組件
react怎么一次渲染多個組件
阿波羅的戰(zhàn)車
2018-08-06 08:00:56
TA貢獻(xiàn)1817條經(jīng)驗(yàn) 獲得超14個贊
1、把組件import進(jìn)來
import { MyComponent1 } from 'components/MyComponent1 '
import { MyComponent2 } from 'components/MyComponent2 '
import { MyComponent3 } from 'components/MyComponent3 '
2、render方法調(diào)用組件
render() {
<div>
<MyComponent1 />
<MyComponent2 />
<MyComponent3 />
</div>
}
舉報(bào)