File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
packages/react-native-reanimated/src/common/style/processors Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,15 @@ export function PlatformColor(...names: Array<string>): PlatformColorValue {
3333 return mapped as PlatformColorValue ;
3434}
3535
36+ function isPlatformColorObject ( value : any ) : boolean {
37+ return (
38+ value &&
39+ typeof value === 'object' &&
40+ ( ( 'semantic' in value && Array . isArray ( value . semantic ) ) ||
41+ ( 'resource_paths' in value && Array . isArray ( value . resource_paths ) ) )
42+ ) ;
43+ }
44+
3645/* copied from:
3746 * https://github.com/facebook/react-native/blob/v0.81.0/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts
3847 */
@@ -118,6 +127,9 @@ export function processColorsInProps(props: StyleProps) {
118127 : undefined ;
119128 }
120129 props [ key ] = processed ;
130+ } else if ( isPlatformColorObject ( value ) ) {
131+ // PlatformColor is not processed further on iOS and Android
132+ props [ key ] = value ;
121133 } else {
122134 props [ key ] = processColor ( value ) ;
123135 }
You can’t perform that action at this time.
0 commit comments