I wanna switch from root ("/") to /login but I wanna that the content from root Page not in /register is there. I wanna an new Page without content from the root page!! I tried everthing, rlly!! I have no clue anymore ;(
Maybe u are better than me :D
My Code:
export default class App extends Component {
render() {
return (
<Router>
<div>
<Route path="/" component={Gui}/>
<Route path="/register" component={Register}/>
</div>
</Router>
);
}
}
I'm assuming you're using
react-router
.Use the
<Switch>
component to only render the first matching route.