Kaynağa Gözat

Redirect home path (/) to recipes

Tatiana Inama 6 yıl önce
ebeveyn
işleme
e97a73f308
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  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,