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

mapState-to-props-no-store false positives on destructured state

calinoracation opened this issue · comments

We have quite a bit of code that destructures state as the first argument of mapStateToProps that then will re-export a subset of the state, I wouldn't expect the following to throw:

const mapStateToProps = ({ header }) => ({
  isLoggedIn: header.user && header.user.isLoggedIn,
  isAdmin: header.admin && header.admin.isAdmin,
});

Thanks for the code. Yes, this is reasonable. Will take a look.