Answer the question
In order to leave comments, you need to log in
How to make it so that on one page only the content changes depending on the router?
There is an inner page
<Switch>
<Route path={'/my'} component={My} />
<Route path={'/payments'} component={Payments} />
...
</Switch>
Answer the question
In order to leave comments, you need to log in
It is possible like this:
const PageLayout = ({ children }) => (
<React.Fragment>
<header>Header</header>
{children}
<footer>Footer</footer>
</React.Fragment>
);
const Page = () => (
<PageLayout>
<Switch>
<Route path='/my' component={My} />
<Route path='/payments' component={Payments} />
</Switch>
</PageLayout>
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question