Answer the question
In order to leave comments, you need to log in
How to connect additional components to react routes?
Добрый день всем. Имеется такая структура:
<Router>
<Fragment>
<Header />
<div className="main">
<Routes />
</div>
<Footer />
</Fragment>
</Router>
Answer the question
In order to leave comments, you need to log in
Good afternoon.
You need to make a common component in which to display the footer and header by the flag and use it inside the routes.
<Fragment>
{thid.props.flag && <Header />}
{this.props.children}
{thid.props.flag && <Footer />}
</Fragment>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question