how to route using switch in react js code example
Example: react router switch
ReactDOM.render((
<Switch>
<Route exact path="/" component={Home} />
<Route path="/login" component={Login} />
<Route path="/explore" component={Explore} />
</Switch>),
document.getElementById('root')
);