Who Is Your Favorite Child?
When we put some content inside the open and close tags of one of our
components, we get access to it as the children
prop.
What happens if we also provide an explicit children
prop to Parent
?
Which will take precedence when we destructure children
in the parent
component?
In the example above, we'll still see Greg and Marsha
rendered. The
content placed inside the tags will take precedence over the explicit
children
prop.
See a live example here.
Tweet