From dc2c1b866a9713014a405b604069e3cc05a7559f Mon Sep 17 00:00:00 2001 From: Andrew Luca Date: Fri, 26 Jul 2019 16:40:04 +0300 Subject: [PATCH] fix(docs): remove `mapDispatchToProps` untruthy use case Tried every form of `mapDispatchToProps` `dispatch` is never missing from `props` --- ...ispatching-actions-with-mapDispatchToProps.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md b/docs/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md index 9734f4620..12c210835 100644 --- a/docs/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md +++ b/docs/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md @@ -254,22 +254,6 @@ connect( )(Counter) ``` -### Manually Injecting `dispatch` - -If the `mapDispatchToProps` argument is supplied, the component will no longer receive the default `dispatch`. You may bring it back by adding it manually to the return of your `mapDispatchToProps`, although most of the time you shouldn’t need to do this: - -```js -import { bindActionCreators } from 'redux' -// ... - -function mapDispatchToProps(dispatch) { - return { - dispatch, - ...bindActionCreators({ increment, decrement, reset }, dispatch) - } -} -``` - ## Defining `mapDispatchToProps` As An Object You’ve seen that the setup for dispatching Redux actions in a React component follows a very similar process: define an action creator, wrap it in another function that looks like `(…args) => dispatch(actionCreator(…args))`, and pass that wrapper function as a prop to your component.