Skip to content

Commit

Permalink
docs: mapDispatchToProps returning undefined (#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 committed Feb 11, 2020
1 parent 607f1ba commit b3db96c
Showing 1 changed file with 6 additions and 2 deletions.
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 b3db96c

Please sign in to comment.