mirror of
https://github.com/react/react-native.git
synced 2026-09-30 17:29:41 +08:00
Fix NativeModuleEnumMembers type (#46222)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46222 This value was typed as always being a string, even though it was containing both strings and numbers in the fixtures. This was because on this line https://fburl.com/code/9j7gh4av the input type is $FlowFixMe (from the source AST), which wasn't catching that it couldn't flow into just `string`. Changelog: [Internal] Reviewed By: makovkastar Differential Revision: D61830075 fbshipit-source-id: 0d5a0239d7c0209049184ca858a7ceb1ada02f79
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0b56ccab2a
commit
a5363113f1
@@ -407,7 +407,7 @@ function generateEnum(
|
||||
const nativeEnumMemberType: NativeEnumMemberValueType =
|
||||
memberType === 'StringTypeAnnotation' ? 'std::string' : 'int32_t';
|
||||
|
||||
const getMemberValueAppearance = (value: string) =>
|
||||
const getMemberValueAppearance = (value: string | number) =>
|
||||
memberType === 'StringTypeAnnotation' ? `"${value}"` : `${value}`;
|
||||
|
||||
const fromCases =
|
||||
|
||||
Reference in New Issue
Block a user