Answer the question
In order to leave comments, you need to log in
How to remove image and return on reclick React?
You need to add a button and an image. When you click on the button, hide the image, when you click again, show it.
I can not figure out how to do it correctly, what would the button be pressed. img disappeared, clicked again appeared, help)
HideImage() {
this.setState({
hideImage: '22'
});
}
<p>
<button onClick={this.HideImage}>Hide Iamge</button>
</p>
<p>
<img src={logo} style={{width: "150px"}} />
</p>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question