Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/components/ui/icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ const iconStyle = tva({
const StyledUIIcon = styled(UIIcon, {
className: {
target: 'style',
// Values must be prop paths, never `true`: react-native-css resolves each one with
// `path.split('.')`, so a boolean throws "undefined is not a function" the moment the class
// actually produces that style key — which for the size variants is every render.
nativeStyleMapping: {
height: true,
width: true,
fill: true,
height: 'height',
width: 'width',
fill: 'fill',
color: 'classNameColor',
stroke: true,
stroke: 'stroke',
},
},
});
Expand Down
4 changes: 3 additions & 1 deletion src/components/ui/spinner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import React from 'react';
import { ActivityIndicator } from 'react-native';

const StyledActivityIndicator = styled(ActivityIndicator, {
className: { target: 'style', nativeStyleMapping: { color: true } },
// A prop path, not `true`: react-native-css calls `.split('.')` on the value, so a boolean
// crashes as soon as the className resolves to a colour.
className: { target: 'style', nativeStyleMapping: { color: 'color' } },
});

const spinnerStyle = tva({});
Expand Down
Loading