(Choose 1 answer)
What will the following code output to the console when a user clicks the button?
class MyButton extends React.Component {
state = { x: 5
}
render() { return (
<button onClick={this.handleClick}>click me</button>);
}
handleClick() {
}
this.setState({x: 10 });
console.log(this.state.x);
ReactDOM.render(<MyButton/>, document.getElementById("root"));
A. 5
B. 10
C. undefined
D. throw a error
Exit 29