Enforces that all mapDispatchToProps parameters have specific names. (react-redux/mapDispatchToProps-prefer-parameters-names)
react-redux mapStateToProps function has 2 optional arguments:
- state
- ownProps
This rule enforces that all of the provided parameters should follow the above naming conventions.
The following pattern is considered incorrect:
const mapDispatchToProps = (anyOtherName) => {}
connect((state) => state, (anyOtherName) => {})(App)
The following patterns are considered correct:
const mapDispatchToProps = () => {}
const mapDispatchToProps = (dispatch, ownProps) => {}
const mapDispatchToProps = (dispatch, {prop1, prop2}) => {}
const mapDispatchToProps = (dispatch) => {}
connect((state) => state, (dispatch, ownProps, moreArgs) => {})(App)