Skip to content

Commit a60e581

Browse files
rickhanloniifacebook-github-bot
authored andcommitted
Better error message for invalid type annotation
Summary: Just a minor error message improvement Reviewed By: TheSavior, osdnk Differential Revision: D16759233 fbshipit-source-id: c53c54535eca683353085a8d2272c60596b52b54
1 parent e110f04 commit a60e581

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-native-codegen/src/generators/components/GeneratePropsH.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ function getNativeTypeFromAnnotation(componentName: string, prop): string {
180180
return getEnumName(componentName, prop.name);
181181
default:
182182
(typeAnnotation: empty);
183-
throw new Error('Received invalid typeAnnotation');
183+
throw new Error(
184+
`Received invalid typeAnnotation for ${componentName} prop ${
185+
prop.name
186+
}, received ${typeAnnotation.type}`,
187+
);
184188
}
185189
}
186190

0 commit comments

Comments
 (0)