How to pass props to {this.props.children}

Cloning children with new props You can use React.Children to iterate over the children, and then clone each element with new props (shallow merged) using React.cloneElement. For example: Calling children as a function Alternatively, you can pass props to children with render props. In this approach, the children (which can be children or any other prop name) is a function which … Read more