How to show and hide element in React?

Posted by Prem Tiwari | Updated on

If you want to show and hide element in React? The key is to update the state of the component in the click handler using setState. When the state changes get applied, the render method gets called again with the new state:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers