<Provider store = {store}>
<Router history = {history} >
<section>
<HeaderWithRouter>
<Route exact path = "/admin" component={Admin}/>
<Route exact path = "/deal" component={FormDeal}/>
<Route exact path="/chart" component={Mycharts}/>
<SubHeaderWithRouter>
<Route exact path="/dealview" component={FinalTable}/>
<Route exact path = "/mandate" component={Mandate}/>
</SubHeaderWithRouter>
</HeaderWithRouter>
<Footer/>
</section>
</Router>
</Provider>
I need to render SubHeaderWithRouter only for the sub routes specified inside it i.e FinalTable and Mandate.
Currently SubHeaderWithRouter is rendered for every route.