Sfoglia il codice sorgente

Redirect home path (/) to recipes

Tatiana Inama 6 anni fa
parent
commit
e97a73f308
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      recipes/src/route.config.tsx

+ 6 - 0
recipes/src/route.config.tsx

@@ -6,12 +6,18 @@ import ViewRecipe from 'containers/Recipes/View';
 import EditRecipe from 'containers/Recipes/Edit';
 import ShoppingList from 'containers/ShoppingCart/List';
 import PlannerContainer from 'containers/Planner';
+import { Redirect } from 'react-router-dom';
 
 const emptyRoute = (title: string) => (props: any) => {
   return (<h1>{title} {props.match.params && props.match.params.id}</h1>);
 };
 
 const routes = [
+  {
+    path: '/',
+    exact: true,
+    component: () => (<Redirect to='/recipes'/>)
+  },
   {
     path: '/recipes',
     component: RecipesContainer,