" /> " /> "/>

how to have same path for multiple component with react-router

315 Views Asked by At

I use react-router 5x..., i search to have the same path but with multiple component, something like

<Route path={"/"} component={App & SeachFlow} />

in my tsx i have

export default (
  <Route component={App}>
    <Route path="/" component={SeachFlow} />
  </Route>
);
1

There are 1 best solutions below

3
Tobias S. On

You can use this notation if you want to display both components:

<Route path={"/"}>
  <App/>
  <SearchFlow/>
</Route>