<Router>
<Switch>
<DataProvider>
<Route path="/" exact><App/></Route>
<Route path="/register" exact><Register/></Route>
<Header/>
<Route path="/main" exact><Main/></Route>
<Route path="/profile" exact><Profile/></Route>
<Footer />
</DataProvider>
</Switch>
</Router>
Is there a way to restrict my <Footer/>
and <Header/>
components from appearing in the "/"
and "/register"
routes?