diff --git a/transforms/__testfixtures__/class-flow1.output.js b/transforms/__testfixtures__/class-flow1.output.js index 0da57e38..7e506225 100644 --- a/transforms/__testfixtures__/class-flow1.output.js +++ b/transforms/__testfixtures__/class-flow1.output.js @@ -4,14 +4,14 @@ var React = require('react'); class Component extends React.Component { props: { - optionalArray?: Array, + optionalArray?: Array<$FlowFixMe>, optionalBool?: boolean, optionalFunc?: Function, optionalNumber?: number, optionalObject?: Object, optionalString?: string, - optionalNode?: any, - optionalElement?: any, + optionalNode?: $FlowFixMe, + optionalElement?: $FlowFixMe, optionalMessage?: Message, optionalEnum?: 'News' | 'Photos' | 1 | true | null | void, optionalUnion?: string | number | Message, diff --git a/transforms/__testfixtures__/class-flow3.output.js b/transforms/__testfixtures__/class-flow3.output.js index 18047e63..932b2337 100644 --- a/transforms/__testfixtures__/class-flow3.output.js +++ b/transforms/__testfixtures__/class-flow3.output.js @@ -24,8 +24,8 @@ class Component extends React.Component { optionalNumber?: $FlowFixMe, optionalObject?: Object, optionalString?: $FlowFixMe, - optionalNode?: any, - optionalElement?: any, + optionalNode?: $FlowFixMe, + optionalElement?: $FlowFixMe, optionalMessage?: Message, optionalEnum?: 'News' | 'Photos' | 1 | true | null, optionalUnion?: $FlowFixMe, diff --git a/transforms/class.js b/transforms/class.js index 81d5a2ac..a008d068 100644 --- a/transforms/class.js +++ b/transforms/class.js @@ -637,15 +637,15 @@ module.exports = (file, api, options) => { any: flowAnyType, array: j.genericTypeAnnotation( j.identifier('Array'), - j.typeParameterInstantiation([flowAnyType]) + j.typeParameterInstantiation([flowFixMeType]) ), bool: j.booleanTypeAnnotation(), - element: flowAnyType, // flow does the same for `element` type in `propTypes` + element: flowFixMeType, // flow does the same for `element` type in `propTypes` func: j.genericTypeAnnotation( j.identifier('Function'), null ), - node: flowAnyType, // flow does the same for `node` type in `propTypes` + node: flowFixMeType, // flow does the same for `node` type in `propTypes` number: j.numberTypeAnnotation(), object: j.genericTypeAnnotation( j.identifier('Object'),