I have an App component, that has child component NavigationBar. That NavigationBar also has children, those are NavigationBarTabs. What I want to do, is to manage routing in App component, but have links in NavigationBarTabs. If I do it this way, I can only get new content in App by refreshing. If I keep links in App component it works fine, but obviously I would like those links to be in NavigationBarTabs. Is there any way I can do that? Examples below:
Works after clicking link:
<BrowserRouter>
<Route path ='/Profile' component = {Profile}/>
<Route path ='/About' component={About}/>
<Route path ='/Catalog' component={Catalog}/>
<Link to={'/Profile'}>Profile</Link>
<Link to={'/Catalog'}>Catalog</Link>
<Link to={'/About'}>About</Link>
</BrowserRouter>
Works after clicking link and refreshing page:
<BrowserRouter>
<NavigationBar/> <--- Tabs with Links are stored there, same 'to' prop
<Route path ='/Profile' component = {Profile}/>
<Route path ='/About' component={About}/>
<Route path ='/Catalog' component={Catalog}/>
</BrowserRouter>