I want to making conditional Header page by page, which means that I don't want to show Header at Home page and I want to show Header at the other pages like posts page, projects page, etc..
I've tried to think how can I solved this problem, but there was no special way to working with react-router-dom. Of course, it may be only hard for me.
Whatever, I can't solve above problem is same.
So, this is current code:
<div className="ui container">
<BrowserRouter>
<Header />
<Route exact path="/">
<Route exact path="/posts">
<Route exact path="/project">
<Route exact path="/profile">
</BrowserRouter>
</div>
and I want fix it like this:
<div className="ui container">
<BrowserRouter>
{() => {
if(path !=="/")
return <Header />;
} else {
return ;
}}
<Route exact path="/">
<Route exact path="/posts">
<Route exact path="/project">
<Route exact path="/profile">
</BrowserRouter>
</div>