Skip to content

Commit

Permalink
Merge pull request #28 from uladzislau-stuk/mapdispatchtoprops_object…
Browse files Browse the repository at this point in the history
…_shorthand

Add object shorthand syntax for mapDispatchToProps
  • Loading branch information
sudheerj committed Aug 2, 2019
2 parents d126a31 + 1e24020 commit 19c32d2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3029,6 +3029,16 @@
}
}
```
Recommend always using the “object shorthand” form for the `mapDispatchToProps`
Redux wrap it in another function that looks like (…args) => dispatch(onTodoClick(…args)), and pass that wrapper function as a prop to your component.
```javascript
const mapDispatchToProps = ({
onTodoClick
})
```
157. ### Can I dispatch an action in reducer?
Expand Down

0 comments on commit 19c32d2

Please sign in to comment.