Render multiple components in React Router

后端 未结 6 1979
野趣味
野趣味 2021-02-05 20:54

I\'m used to application layouts with multiple yield areas, i.e. for content area and for top bar title. I\'d like to achieve something similar in React Router. For example:

6条回答
  •  日久生厌
    2021-02-05 21:21

    Another method is within the render method of route multiple passed components can be created using react.createElement

    React.createElement(Component1, {...props}},
                         React.createElement(Component2, {...props}}/> 
    

提交回复
热议问题