Fix processColor ESM for codegen

Summary: Changelog: [Internal] Fix broken usage of `processColor`

Reviewed By: GijsWeterings

Differential Revision: D42346452

fbshipit-source-id: 20be00210f5b68c15292c8a8c1cd918b23fb1fd6
This commit is contained in:
Luna Wei
2023-01-04 13:58:40 -08:00
committed by Facebook GitHub Bot
parent 0c53420a7a
commit fdc2836305
3 changed files with 7 additions and 7 deletions
@@ -107,7 +107,7 @@ export const __INTERNAL_VIEW_CONFIG = {
validAttributes: {
tintColor: {
process: require('react-native/Libraries/StyleSheet/processColor'),
process: require('react-native/Libraries/StyleSheet/processColor').default,
},
},
};
@@ -502,11 +502,11 @@ export const __INTERNAL_VIEW_CONFIG = {
},
color: {
process: require('react-native/Libraries/StyleSheet/processColor'),
process: require('react-native/Libraries/StyleSheet/processColor').default,
},
thumbTintColor: {
process: require('react-native/Libraries/StyleSheet/processColor'),
process: require('react-native/Libraries/StyleSheet/processColor').default,
},
point: {
@@ -65,7 +65,7 @@ function getReactDiffProcessValue(typeAnnotation: PropTypeAnnotation) {
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return j.template
.expression`{ process: require('react-native/Libraries/StyleSheet/processColor') }`;
.expression`{ process: require('react-native/Libraries/StyleSheet/processColor').default }`;
case 'ImageSourcePrimitive':
return j.template
.expression`{ process: require('react-native/Libraries/Image/resolveAssetSource') }`;
@@ -142,7 +142,7 @@ export const __INTERNAL_VIEW_CONFIG = {
validAttributes: {
tintColor: {
process: require('react-native/Libraries/StyleSheet/processColor'),
process: require('react-native/Libraries/StyleSheet/processColor').default,
},
},
};
@@ -812,11 +812,11 @@ export const __INTERNAL_VIEW_CONFIG = {
},
color: {
process: require('react-native/Libraries/StyleSheet/processColor'),
process: require('react-native/Libraries/StyleSheet/processColor').default,
},
thumbTintColor: {
process: require('react-native/Libraries/StyleSheet/processColor'),
process: require('react-native/Libraries/StyleSheet/processColor').default,
},
point: {