I guess .click function comes from jquery but I saw it in pure js too so I hope I can use it in my react code too. The event where I want to use it looks like
 keyUpFunction(event) {
    console.log(event.keyCode);
    event.preventDefault();
    if(event.keyCode == 13) {
        console.log("blya");
        document.getElementsByClassName('button').click();
    };
}
...
<input onChange={this.updateMessage} onKeyUp={this.keyUpFunction} value={this.state.message} type='text' placeholder="Message" />
<button className="button"  onClick={this.submitMessage} >Submit Message</button>
The idea is after writing message I will push enter, onKeyUp will get it go to event handler and run getElementByClassName().click() and submit the message(run onClick). If I am wrong and I can't use click in react how can I implement it? both console.logs are working correctlly so the problem is in click()(I guess)
And here is the whole code
 
     
    