File tree Expand file tree Collapse file tree 6 files changed +13
-2
lines changed
packages/react-native-codegen/src/parsers Expand file tree Collapse file tree 6 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ function findEventArgumentsAndType(
223223 : null ;
224224 if (
225225 typeAnnotation . typeParameters . params [ 0 ] . type ===
226- 'NullLiteralTypeAnnotation'
226+ parser . nullLiteralTypeAnnotation
227227 ) {
228228 return {
229229 argumentProps : [ ] ,
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ class FlowParser implements Parser {
6666 enumDeclaration : string = 'EnumDeclaration' ;
6767 interfaceDelcaration : string = 'InterfaceDeclaration' ;
6868
69+ nullLiteralTypeAnnotation : string = 'NullLiteralTypeAnnotation' ;
70+
6971 isProperty ( property : $FlowFixMe ) : boolean {
7072 return property . type === 'ObjectTypeProperty' ;
7173 }
Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ export interface Parser {
9898 */
9999 interfaceDelcaration: string ;
100100
101+ /**
102+ * This is the NullLiteralTypeAnnotation value
103+ */
104+ nullLiteralTypeAnnotation: string ;
105+
101106 /**
102107 * Given a declaration, it returns true if it is a property
103108 */
Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ export class MockedParser implements Parser {
6464 enumDeclaration : string = 'EnumDeclaration' ;
6565 interfaceDelcaration : string = 'InterfaceDelcaration' ;
6666
67+ nullLiteralTypeAnnotation : string = 'NullLiteralTypeAnnotation' ;
68+
6769 isProperty ( property : $FlowFixMe ) : boolean {
6870 return property . type === 'ObjectTypeProperty' ;
6971 }
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ function findEventArgumentsAndType(
237237 : null ;
238238
239239 switch ( typeAnnotation . typeParameters . params [ 0 ] . type ) {
240- case 'TSNullKeyword' :
240+ case parser . nullLiteralTypeAnnotation :
241241 case 'TSUndefinedKeyword' :
242242 return {
243243 argumentProps : [ ] ,
Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ class TypeScriptParser implements Parser {
6464 enumDeclaration : string = 'TSEnumDeclaration' ;
6565 interfaceDelcaration : string = 'TSInterfaceDeclaration' ;
6666
67+ nullLiteralTypeAnnotation : string = 'TSNullKeyword' ;
68+
6769 isProperty ( property : $FlowFixMe ) : boolean {
6870 return property . type === 'TSPropertySignature' ;
6971 }
You can’t perform that action at this time.
0 commit comments