My App.js:
<Router>
<Route
path="/"
exact
component={HomePage}
/>
<Switch>
<Route path="/register" component={Register} />
<Route path="/login" component={Login} />
<Route path="/forgot" component={ForgotForm} />
<Route path="/reset" component={ResetForm} />
</Switch>
</Router>
My HomePage looks like that:
<Header />
<Container>
<Row>
<Col className="col-xs-3 col-sm-3 col-md-3 col-lg-3 col">
<SideBar />
</Col>
<Col className="col-xs-9 col-sm-9 col-md-9 col-lg-9">
<SearchDialog />
<DialogPage />
<MessagePage />
//I need to change components in this area when link will be switched
</Col>
</Row>
</Container>
My auth components (register/login/ etc) works perfectly because they don`t need to have sidebar/header like in homepage. HomePage has Sidebar, header and content, which should change when you click on another link. If I place a new Route in App.js with this link, this component will load, but without HomePage.