Skip to content
Advertisement

React How to change view after click on button

I wouldlike to change my view when I click on one Button :

JavaScript

For example when I click on the button 1, only View1 is active. If I click on Button 2 ==> View 2 If I click on Button 3 ==> View 3

PS : View1, View2 and View3 are component file (.jsx)

Advertisement

Answer

There are multiple ways to do this. You can set flags around the views. For example

JavaScript
Advertisement