In ReactJS
, I have this routes:
<Route exact path="/" component={Home}/>
<Route path="/:id" component={Profile}/>
<Route path="/settings" component={Settings}/>
when I request
www.example.com/username
I get the Profile
component as expected, but the problem is
when I request
www.example.com/settings
the page render two components at the same time
first I get the Profile
component and below it, I get Settings
component
how can I handle this case in React JS?