Skip to main content

3.13 Children Prop

The special props.children property for data between the start end end tags.

You should know that after this:

const person = (props) => {
return (
<div>
<p>
I'm {props.name} and I am {props.age} years old!
</p>
<p>{props.children}</p>
</div>
)
}

// With <Person name="Stephanie" age="26" />

You got this in the browser:

...
<div>
<p>I'm Stephanie and I am 26 years old!</p>
<p></p>
</div>
...

If between the opening and closing tags is empty.