Unverified Commit 43369bde authored by Yash Joshi's avatar Yash Joshi Committed by GitHub
Browse files

fix(routes): update key and redirect home to application (#342)

parent da5bf3ae
Showing with 6 additions and 4 deletions
+6 -4
import NotFound from 'components/NotFound';
import Spinner from 'components/Spinner';
import ROUTES from 'constants/routes';
import AppLayout from 'container/AppLayout';
import history from 'lib/history';
import React, { Suspense } from 'react';
import { Route, Router, Switch } from 'react-router-dom';
import { Redirect, Route, Router, Switch, } from 'react-router-dom';
import routes from './routes';
......@@ -12,12 +13,13 @@ const App = (): JSX.Element => (
<AppLayout>
<Suspense fallback={<Spinner size="large" tip="Loading..." />}>
<Switch>
{routes.map(({ path, component, exact }, index) => {
{routes.map(({ path, component, exact }) => {
return (
<Route key={index} exact={exact} path={path} component={component} />
<Route key={path} exact={exact} path={path} component={component} />
);
})}
<Route path="*" exact component={NotFound} />
<Redirect from="/" to={ROUTES.APPLICATION} />
<Route component={NotFound} />
</Switch>
</Suspense>
</AppLayout>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment