I have App.js file something like this
import {BrowserRouter,Switch,Route} from 'react-router-dom'
<BrowserRouter>
<Switch>
<Route exact path="/" component={LandingPage} />
<Route path="/searchResults" component={SearchResults} />
</Switch>
</BrowserRouter>
And {SearchResults}
looks like this
<Navbar />
<Switch>
<Route path="/all" component={All} />
<Route path="/courses" component={Courses} />
<Route path="/slides" component={Slides} />
</Switch>
I need to make /searchResults/all
, /searchResults/courses
and searchResults/slides
work
I tried above approach but the output is blank when i go to any of these routes.Only Navbar is rendered.