codemod-proptypes-to-flow
codemod-proptypes-to-flow copied to clipboard
Flow props are now a generic type
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(?).
Added https://github.com/billyvg/codemod-proptypes-to-flow/pull/23 that fixes it