Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'react/jsx-no-bind' doesn't recognise ternary conditions #1722

Closed
gwenaellarmet opened this issue Mar 13, 2018 · 2 comments
Closed

'react/jsx-no-bind' doesn't recognise ternary conditions #1722

gwenaellarmet opened this issue Mar 13, 2018 · 2 comments

Comments

@gwenaellarmet
Copy link
Contributor

render () {
  return (
     <MyComponent
       onValidate={this.isAdmin ? this.onValidateAdmin.bind(this) : this.onValidate.bind(this)}
       onRequestClose={this.onRequestClose.bind(this)}
       {...props}
    >
  )
}

In the code above, the rules 'react/jsx-no-bind' is marking onRequestClose as a warning but not onValidate, although it should in my opinion.

I'll open a PR fixing this bug.

@gwenaellarmet
Copy link
Contributor Author

PR #1723 fix this bug, need review and merge if accepted

@gwenaellarmet
Copy link
Contributor Author

Bug was fixed 👍

This was referenced Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants