I have a Parent component which includes a Child component and passes it some render props.
const Parent = () => {
return(
<div>
<h1>Title</h1>
<Child>
Text that I want
</Child>
</div>
)
}
class Child extends React.Component{
handleClick() {
console.log('Hi')
}
render() {
return(
{this.props.children}
)
}
}
How can I make it so when the render props content "Text that I want" is clicked the Child's handleClick function is executed?