DianaSuvorova / eslint-plugin-react-redux

Enforcing best practices for react-redux

Home Page:https://www.npmjs.com/package/eslint-plugin-react-redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Says prop is unused but it is used within mapStateToProps

binarykitchen opened this issue · comments

Experiencing here a false warning with the latest version. For example in the React component I have this

  static propTypes = {
    companyKey: PropTypes.string.isRequired
  }

and further down

const mapStateToProps = (db, props) => ({
  size: size(db, props.companyKey),
  loading: loading(db, props.companyKey)
})

yet it complains with

  10:5   error    'companyKey' PropType is defined but prop is never used       react-redux/no-unused-prop-types
  10:5   error    'companyKey' PropType is defined but prop is never used       react/no-unused-prop-types

That prop is not used in the React component within but in react-redux mapDbToProps function so it should be good.

@DianaSuvorova is there any update on this issue?