state = {
value: true,
};
onClick = () => {
this.setState({ value: !this.state.value });
};
<Component click={this.onClick} />
const test = ({ click }) => {
return (
<div>
<button onClick={click}>click</button>
</div>
);
};