Answers for "reactrouter v6 multiple path in a single route path"

6

react router multiple path

<Router>
    <Route path={["/home", "/users", "/widgets"]} component={Home} />
</Router>
Posted by: Guest on March-08-2021
1

how to add two elements in one path in react router v6

This is older version looks like
<Route path="/">
 <Header/>
 <Home/>
</Route>

Now you should Write like this in V6

<Route exact path="/" element={<><Header/><Home/></>}/>
Posted by: Guest on December-30-2021

Browse Popular Code Answers by Language