mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
RN: Add RootTag to New Commands Codegen
Summary: Adds support for `RootTag` in the new codegen for Native Component Commands. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21169371 fbshipit-source-id: 3b25433f3328e9c04cfe45bb176fc06d63559f14
This commit is contained in:
committed by
Facebook GitHub Bot
parent
310b0c3af5
commit
4d9fa4b08e
+12
-2
@@ -125,7 +125,17 @@ function generatePropsString(component: ComponentShape, imports) {
|
||||
}
|
||||
|
||||
function getCommandArgJavaType(param) {
|
||||
switch (param.typeAnnotation.type) {
|
||||
const {typeAnnotation} = param;
|
||||
|
||||
switch (typeAnnotation.type) {
|
||||
case 'ReservedFunctionValueTypeAnnotation':
|
||||
switch (typeAnnotation.name) {
|
||||
case 'RootTag':
|
||||
return 'double';
|
||||
default:
|
||||
(typeAnnotation.name: empty);
|
||||
throw new Error(`Receieved invalid type: ${typeAnnotation.name}`);
|
||||
}
|
||||
case 'BooleanTypeAnnotation':
|
||||
return 'boolean';
|
||||
case 'DoubleTypeAnnotation':
|
||||
@@ -137,7 +147,7 @@ function getCommandArgJavaType(param) {
|
||||
case 'StringTypeAnnotation':
|
||||
return 'String';
|
||||
default:
|
||||
(param.typeAnnotation.type: empty);
|
||||
(typeAnnotation.type: empty);
|
||||
throw new Error('Receieved invalid typeAnnotation');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user