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/prop-types: false positive #1998

Closed
ferhatelmas opened this issue Sep 26, 2018 · 3 comments
Closed

react/prop-types: false positive #1998

ferhatelmas opened this issue Sep 26, 2018 · 3 comments

Comments

@ferhatelmas
Copy link
Contributor

ferhatelmas commented Sep 26, 2018

After babel-eslint 10.0

type Props = {
  onRowSelected: string => void,
  users: Array<UserType>
}

export default class NetworkTable extends Component<Props> {
  onRowSelected = (event: { data: { profile: string } }) => {
    const { onRowSelected } = this.props
    onRowSelected(event.data.profile)
  }
.../table.js
  24:13  error  'onRowSelected' is missing in props validation  react/prop-types

Versions:

  • eslint: 5.6.0
  • eslint-plugin-react: 7.11.1
  • babel-eslint: 10.0.0
  • react: 16.5.2
@ljharb
Copy link
Member

ljharb commented Sep 26, 2018

If you name the class field something else, does the error disappear?

@ferhatelmas
Copy link
Contributor Author

@ljharb it doesn't disappear but it seems babel/babel-eslint#697 fixed issue for us.

@ljharb
Copy link
Member

ljharb commented Sep 28, 2018

OK - I'm going to close this then, as it seems a bug in babel-eslint.

@ljharb ljharb closed this as completed Sep 28, 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