Skip to content

Commit

Permalink
docs: mapDispatchToProps returning undefined (reduxjs#1520)
Browse files Browse the repository at this point in the history
Arrow function wasn’t returning an object, those braces were a code block.
  • Loading branch information
Vladyslav Dalechyn authored Feb 11, 2020
1 parent f820c0e commit 36448bf
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ render() {
}

const mapDispatchToProps = dispatch => {
toggleTodo: todoId => dispatch(toggleTodo(todoId))
return {
toggleTodo: todoId => dispatch(toggleTodo(todoId))
}
}
```

Expand All @@ -171,7 +173,9 @@ render() {
}

const mapDispatchToProps = (dispatch, ownProps) => {
toggleTodo: () => dispatch(toggleTodo(ownProps.todoId))
return {
toggleTodo: () => dispatch(toggleTodo(ownProps.todoId))
}
}
```

Expand Down

0 comments on commit 36448bf

Please sign in to comment.