-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
The following code:
type MyType<T> = Array<T>;
export type Props = {
numbers: MyType<number>,
};
results in the following error:
TypeError: internalTypes[node.id.name] is not a function
49 | else if (node.type === 'GenericTypeAnnotation' && node.typeParameters) {
50 | const realTypeParameters = node.typeParameters.params.map(p => mapGenericToRealType(p, typeParamMapping));
> 51 | return internalTypes[node.id.name](realTypeParameters);
| ^
52 | }
53 | else if (node.type === 'ArrayTypeAnnotation') {
54 | const realElementType = mapGenericToRealType(node.elementType, typeParamMapping);
at convertGenericToPropTypes (src/convertToPropTypes.js:51:12)
...
I put a break point there and discovered that "Array" is not a key of internalTypes and this is what was triggering the failure.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels