How can I set up multiple Paths to one element with Routers?
It used to be like:
<Route path = {['example1','example2',...,'exampleN']} element = {<Test />} />
How do I get the same result in the newest Version?
How can I set up multiple Paths to one element with Routers?
It used to be like:
<Route path = {['example1','example2',...,'exampleN']} element = {<Test />} />
How do I get the same result in the newest Version?
You can map over the array to create the Route elements:
{["/", "/home"].map((path, index) => {
return (
<Route path={path} element={
<PageWrapper>
<Home />
</PageWrapper>
}
key={index}
/>
);
})}