Skip to content

Extracted flow 0.53 props from react component are not recognized #207

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

Closed
danrot opened this issue Aug 17, 2017 · 6 comments
Closed

Extracted flow 0.53 props from react component are not recognized #207

danrot opened this issue Aug 17, 2017 · 6 comments
Labels

Comments

@danrot
Copy link

danrot commented Aug 17, 2017

I have just changed our codebase to the new flow types for React (meaning to use stuff as described here).

So my react classes now look like that:

type Props = {
    value: boolean,
};

class MyComponent extends React.Component<Props> {
    // ...
}

These props are then not recognized by the library anymore... I am using version 2.17.0.

@rosskevin
Copy link
Contributor

Please change the title to something referencing Flow 53, hopefully this will get everyone's attention

@danrot danrot changed the title Extracted props from react component are not recognized Extracted flow 0.53 props from react component are not recognized Aug 23, 2017
@danrot
Copy link
Author

danrot commented Aug 23, 2017

@rosskevin Changed it, but I doubt that this helps...

@fkling
Copy link
Member

fkling commented Aug 23, 2017

That's an easy fix.

typePath = superTypes.get('params').get(1);

should be instead

typePath = superTypes.get('params').get(0);

Thank you for opening the issue!

@fkling fkling added the bug label Aug 23, 2017
@danrot
Copy link
Author

danrot commented Aug 24, 2017

Do you want me to fix it, or do you do it on your own?

@danez
Copy link
Collaborator

danez commented Aug 24, 2017

Feel free to make a PR.

We should also make sure it works also with old and new flow versions.

something like this.

const params = superTypes.get('params');
if (params.value.length === 3) {
  typePath = params.get(1);
} else {
 typePath = params.get(0);
}

@danez
Copy link
Collaborator

danez commented Aug 24, 2017

I created a PR which fixes this #209

@danez danez closed this as completed in #209 Sep 5, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants