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:
Jacob Kozol 2021-11-16 22:00:54 +01:00 committed by jkozol
parent c6f2ed227f
commit 81acb2bb57

View file

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