R201_-_FE_-_SU_2023_486.webp
T

R201_-_FE_-_SU_2023_486.webp

(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
  • Like
Reactions: tonylg

Thông tin

Category
FER201m
Thêm bởi
thanhhoa88
Ngày thêm
Lượt xem
734
Lượt bình luận
4
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
R201_-_FE_-_SU_2023_486.webp
File size
53.4 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom