Skip to content

Commit f6be412

Browse files
authored
Merge pull request #240 from sendbird/fix/support-border-radius-type
[CLNP-6724] fix: allow string values for borderRadius in StyleSheet
2 parents 7de7a89 + 3d02958 commit f6be412

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/uikit-react-native-foundation/src/styles/createStyleSheet.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ const SCALE_FACTOR_WITH_DIMENSION_VALUE = (
1313
};
1414

1515
const DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE = (
16-
val: NonNullable<AnimatableNumericValue | undefined>,
17-
): NonNullable<AnimatableNumericValue | undefined> => {
16+
val: NonNullable<AnimatableNumericValue | string | undefined>,
17+
): NonNullable<AnimatableNumericValue | string | undefined> => {
1818
return typeof val === 'number' ? DEFAULT_SCALE_FACTOR(val) : val;
1919
};
2020

2121
const preProcessor: Partial<StylePreprocessor> = {
2222
'fontSize': DEFAULT_SCALE_FACTOR,
2323
'lineHeight': DEFAULT_SCALE_FACTOR,
24+
//@ts-ignore : Ensure compatibility with all supported React Native versions
2425
'borderRadius': DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE,
2526
'minWidth': SCALE_FACTOR_WITH_DIMENSION_VALUE,
2627
'maxWidth': SCALE_FACTOR_WITH_DIMENSION_VALUE,

0 commit comments

Comments
 (0)