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 doesn't work correctly with Flow #2333

Closed
pbondoer opened this issue Jun 27, 2019 · 1 comment
Closed

react/prop-types doesn't work correctly with Flow #2333

pbondoer opened this issue Jun 27, 2019 · 1 comment
Labels

Comments

@pbondoer
Copy link

pbondoer commented Jun 27, 2019

Example code:

// @flow

type Role = 'owner' | 'admin' | 'user';

type Props = {|
  contacts: { [role: Role]: string },
|};

export default class MyClass extends React.Component<Props> {
  render() {
    return (
      <>
        {contacts.owner}
      </>
    );
  }
}

Error:

error  'contacts.owner' is missing in props validation  react/prop-types

Using eslint-plugin-react@7.14.2 and eslint@5.16.0.

This does not happen with eslint-plugin-react@7.13.0.

@yannickcr
Copy link
Member

yannickcr commented Jun 27, 2019

Duplicate of #2330.

It should be fixed in the next release.

@ljharb ljharb added the flow label Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants