Skip to content

Commit

Permalink
Get rid of console warnings in TodoApp of docs (#2711)
Browse files Browse the repository at this point in the history
* Get rid of console warnings in TodoApp of docs

Add default case for `getVisibleTodos` and remove `#` from href in `Link.js`

* Update ExampleTodoList.md
  • Loading branch information
ACollectionOfAtoms authored and timdorr committed Nov 13, 2017
1 parent ef2ce0e commit 12666b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions docs/basics/ExampleTodoList.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const Link = ({ active, children, onClick }) => {

return (
<a
href="#"
href=""
onClick={e => {
e.preventDefault()
onClick()
Expand Down Expand Up @@ -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
}
}

Expand Down
7 changes: 4 additions & 3 deletions docs/basics/UsageWithReact.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const Link = ({ active, children, onClick }) => {

return (
<a
href="#"
href=""
onClick={e => {
e.preventDefault()
onClick()
Expand Down Expand Up @@ -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
}
}

Expand Down

0 comments on commit 12666b9

Please sign in to comment.