React Router: Named Components

Share this video with your friends

Send Tweet

In this lesson we'll learn how to render multiple component children from a single route.

Zhenyang Hua
Zhenyang Hua
~ 8 years ago

Does it has to be "body" and "header" as keywords? What decides the order of the subcomponents being rendered?

Joe Maddalone
Joe Maddalone(instructor)
~ 8 years ago

No the keys can be whatever you like, sorry if that was not clear.

The order is decided by however you lay your components out, this is covered at 0:25 in the lesson.

const Container = (props) =>
  <div>{props.header}{props.body}<Links /></div>