Skip to content

Commit 5086108

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Assert ImageRequest is not used as a prop in codegen (#51642)
Summary: Pull Request resolved: #51642 This diff asserts that ImageRequest won't be used as prop type changelog: [internal] internal Reviewed By: mlord93 Differential Revision: D75469453 fbshipit-source-id: e9e46bc8806e00c104b76825445fe72779106220
1 parent 20da141 commit 5086108

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ function generatePropsDiffString(
102102
if (${prop.name} != oldProps->${prop.name}) {
103103
result["${prop.name}"] = *${prop.name};
104104
}`;
105-
case 'ImageSourcePrimitive':
106105
case 'ImageRequestPrimitive':
106+
// Shouldn't be used in props
107+
throw new Error(
108+
'ImageRequestPrimitive should not be used in Props',
109+
);
110+
case 'ImageSourcePrimitive':
107111
case 'PointPrimitive':
108112
case 'EdgeInsetsPrimitive':
109113
case 'DimensionPrimitive':

0 commit comments

Comments
 (0)