Is providing a setState-function as onClick-property directly a bad thing, cause the function will be defined with every render again? Should it be declared as function instead, e. g. this.open?
render() {
return (
<div>
<button
type="button"
onClick={() => this.setState({ isOpen: !this.state.isOpen })}
/>
</div>
);
}