From 12666b945817b99c625815b60ccb886b29e5159c Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 13 Nov 2017 08:11:41 -0500 Subject: [PATCH] Get rid of console warnings in TodoApp of docs (#2711) * Get rid of console warnings in TodoApp of docs Add default case for `getVisibleTodos` and remove `#` from href in `Link.js` * Update ExampleTodoList.md --- docs/basics/ExampleTodoList.md | 7 ++++--- docs/basics/UsageWithReact.md | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/basics/ExampleTodoList.md b/docs/basics/ExampleTodoList.md index d92d0b20ca..87cac7405d 100644 --- a/docs/basics/ExampleTodoList.md +++ b/docs/basics/ExampleTodoList.md @@ -182,7 +182,7 @@ const Link = ({ active, children, onClick }) => { return ( { e.preventDefault() onClick() @@ -259,12 +259,13 @@ import TodoList from '../components/TodoList' const getVisibleTodos = (todos, filter) => { switch (filter) { - case 'SHOW_ALL': - return todos case 'SHOW_COMPLETED': return todos.filter(t => t.completed) case 'SHOW_ACTIVE': return todos.filter(t => !t.completed) + case 'SHOW_ALL': + default: + return todos } } diff --git a/docs/basics/UsageWithReact.md b/docs/basics/UsageWithReact.md index 43be4842f1..a09285a494 100644 --- a/docs/basics/UsageWithReact.md +++ b/docs/basics/UsageWithReact.md @@ -179,7 +179,7 @@ const Link = ({ active, children, onClick }) => { return ( { e.preventDefault() onClick() @@ -235,12 +235,13 @@ To use `connect()`, you need to define a special function called `mapStateToProp ```js const getVisibleTodos = (todos, filter) => { switch (filter) { - case 'SHOW_ALL': - return todos case 'SHOW_COMPLETED': return todos.filter(t => t.completed) case 'SHOW_ACTIVE': return todos.filter(t => !t.completed) + case 'SHOW_ALL': + default: + return todos } }