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

Properties with dash defined with Flow aren't detected #1299

Closed
FezVrasta opened this issue Jul 13, 2017 · 3 comments
Closed

Properties with dash defined with Flow aren't detected #1299

FezVrasta opened this issue Jul 13, 2017 · 3 comments

Comments

@FezVrasta
Copy link

FezVrasta commented Jul 13, 2017

type Props = {
  'data-action': string,
};

function Button({ 'data-action': dataAction }: Props) {
  return <div data-action={dataAction} />;
}

error 'data-action' is missing in props validation react/prop-types

@FezVrasta
Copy link
Author

I noticed I can use a computed property name to avoid the error.

function Button({ ['data-action']: dataAction }: Props) {

@alexzherdev
Copy link
Contributor

I made a test case with the code from the issue and it passed.

@ljharb
Copy link
Member

ljharb commented Jul 24, 2018

Let’s merge that into master to close this issue :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants