render() {
return (
<div>
<label>
<input type="checkbox" value="1" defaultChecked={this.state.checked[1]}/>
first
</label>
<br />
<label>
<input type="checkbox" value="2" defaultChecked={this.state.checked[2]}/>
two
</label>
<br />
<label>
<input type="checkbox" value="3" defaultChecked={this.state.checked[3]}/>
tree
</label>
<br />
<button onClick={this.handleButton}>
reverse
</button>
</div>
)
}
var event = document.createEvent('Event');
event.initEvent('clicker', true, true)
document.addEventListener('clicker', function(e) {
alert('я сработал')
})
document.addEventListener('click', function (e) {
document.dispatchEvent(event);
})