January 11, 2017

What is this.props.children

When I first saw this API, its about to tear my head apart, and now I will share with you about what I have learned on this.props.children
the concept is easy:
Imaging you have Parent component that call child component that works fine,

what if you want to pass in the props to parent and render whatever the props is, yet should show in child and wrap in child div...

so this.props.children works little bit like in Meteor blade or emberjs, now I will put everything together and this is how I would use this.props.children