Add more test coverage for $ReadOnlyArray<UnsafeMixed> in component codegen (#49349)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49349

Follow-up on D69454101 to add more test coverage for `$ReadOnlyArray<UnsafeMixed>` as a component prop. The new type was missing from the CodegenSchema, which revealed some gaps in tests.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D69488035

fbshipit-source-id: 19895e55e5ec4d89a790f1c388de9eea025a316c
This commit is contained in:
Pieter De Baets
2025-02-12 04:20:08 -08:00
committed by Facebook GitHub Bot
parent 96a8a3da48
commit 9073817925
15 changed files with 125 additions and 3 deletions
@@ -80,6 +80,7 @@ export type PojoTypeAnnotation =
| DoubleTypeAnnotation
| FloatTypeAnnotation
| Int32TypeAnnotation
| MixedTypeAnnotation
| $ReadOnly<{
type: 'StringEnumTypeAnnotation',
default: string,
@@ -148,6 +148,10 @@ function toJavaType(
case 'Int32TypeAnnotation': {
return 'Integer';
}
case 'MixedTypeAnnotation': {
importDynamic();
return 'Dynamic';
}
/**
* Enums
@@ -214,7 +218,7 @@ function toJavaType(
default: {
(elementType.type: empty);
throw new Error(
`Unrecognized PojoTypeAnnotation Array element type annotation '${typeAnnotation.type}'`,
`Unrecognized PojoTypeAnnotation Array element type annotation '${elementType.type}'`,
);
}
}