Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Latest commit

 

History

History
31 lines (22 loc) · 780 Bytes

connect-prefer-named-arguments.md

File metadata and controls

31 lines (22 loc) · 780 Bytes

Enforces that all connect arguments have recommended names. (react-redux/connect-prefer-named-arguments)

react-redux connect function has 4 optional arguments:

  • mapStateToProps
  • mapDispatchToProps
  • mergeProps
  • options

This rule enforces that all of the provided parameters should follow the above naming conventions.

Rule details

The following patterns are considered incorrect:

connect(mapStateToProps, actionCreators)(TodoApp)
connect(state => state)(TodoApp)

The following patterns are considered correct:

connect(mapStateToProps, mapDispatchToProps, mergeProps)(TodoApp)
connect()(TodoApp)