robert trudel
robert trudel

Reputation: 5749

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

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>
);

Upvotes: 0

Views: 368

Answers (1)

Tobias S.
Tobias S.

Reputation: 23825

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

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

Upvotes: 1

Related Questions