Hello!

Help me figure out this.props.children

I have undefined it in all the components of the tree. Played with examples from react-select - in some cases this property exists, in others it does not. As I understand it, children are created in the render method. If in component

render() { return <div/> } 

Should the div get into the children?

Thank.

    1 answer 1

    this.props is what is passed from the parent

    If in the render write

     <MyComp> {'123'} </MyComp> 

    then this.props.children '123' will appear in MyComp