Router: update Route components
In React Router v6 the Route paramater 'exact' is replaced by using a trailing * to indicate the path matches deeply. Also, elements are now preferred over components. React, itself, has also been making this switch. Using elements is simpler than components and integrates better with hooks.
This commit is contained in:
parent
c6f2ed227f
commit
81acb2bb57
1 changed files with 2 additions and 2 deletions
|
|
@ -7,8 +7,8 @@ const CreateImageWizard = lazy(() => import('./Components/CreateImageWizard/Crea
|
|||
export const Router = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route exact path='/landing' component={ LandingPage } />
|
||||
<Route exact path='/imagewizard' component={ CreateImageWizard } />
|
||||
<Route path='/landing/*' element={ <LandingPage /> } />
|
||||
<Route path='/imagewizard/*' element={ <CreateImageWizard /> } />
|
||||
<Redirect to='/landing' />
|
||||
</Routes>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue