Enforces that all mapStateToProps parameters have specific names. (react-redux/mapStateToProps-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 mapStateToProps = (anyOtherName) => {}
connect(function(anyOtherName) {}, null)(App)
The following patterns are considered correct:
const mapStateToProps = (state, ownProps) => {}
const mapStateToProps = (state) => {}
const mapStateToProps = ({isActive}) => {isActive}
connect((state) => state, null)(App)