I'm trying to create a toggle button component with two buttons, where clicking on one disables the other and vice versa. I have a disabled state I know I have to toggle. But I'm not sure how to pan out the logic. Should there be one disabled state or two since there are two buttons?
constructor(props) {
super(props);
this.state = { disabled: false }
}
clicky(e) {
//should dictate the toggle logic
}
render () {
<div onClick={this.clicky.bind(this)}>
<button disabled={this.state.disabled}>Item 1</button>
<button disabled={this.state.disabled}>Item 2</button>
</div>
}