Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Flow props are now a generic type #19

Open
iainbeeston opened this issue Feb 26, 2018 · 1 comment
Open

Flow props are now a generic type #19

iainbeeston opened this issue Feb 26, 2018 · 1 comment

Comments

@iainbeeston
Copy link

In the latest versions of flow, proptypes are no longer a class property when using es6 classes, eg.

export type Props = {
  foo: number
}

class MyComponent extends React.Component {
  props: Props
}

Instead React.Component is a generic type, and it expects the props to be passed into that instead:

export type Props = {
  foo: number
}

class MyComponent extends React.Component<Props> {
}

The codemod is currently doing the former, but I suspect it should be either updated to do the latter, or have a flag that lets it do either depending on the flow version(?).

@kangax
Copy link

kangax commented Sep 6, 2018

Added #23 that fixes it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants