What I want to achieve..
Able to route in two different navbars
route components herewhen you login
route dashboard components hereMore explanation
I have a landing page component
<navbar/>
about page, contact, features and pricing are been routed here
<Router>
<Switch>
<Route exact path="/pricing" component={Pricing}/>
<Route exact path="/about" component={About}/>
<Route exact path="/" component={Home}/>
<Switch/>
</Router>
<footer/>
now when you're logged in
there's a new navbar and sidebar for the dashboard
all other dashboard components should be routed here
<Router>
<Navbar />
<Switch>
<Route exact path="/dashboard/edit" component={Edit} />
<Route exact path="/dashboard/invite" component={Invite} />
<Route exact path="/dashboard" component={Dashboard} />
<Switch>
<Sidebar />
<Router>
current solution is to repeat the sidebar and navbar components on every dashboard components then declare them as route path in the router wrapper
I do not want to repeat the sidebar and navbar on every dashboard component
Please let me know if there's any better way to achieve this