mirror of
https://github.com/zoriya/react-native-web.git
synced 2025-12-06 06:36:13 +00:00
committed by
Nicolas Gallagher
parent
213b616b3c
commit
617b438530
@@ -99,6 +99,12 @@ describe('StyleSheet/preprocess', () => {
|
||||
expect(preprocess({ aspectRatio: 9 / 16 })).toEqual({
|
||||
aspectRatio: '0.5625'
|
||||
});
|
||||
|
||||
expect(preprocess({ aspectRatio: '0.5' })).toEqual({
|
||||
aspectRatio: '0.5'
|
||||
});
|
||||
|
||||
expect(preprocess({ aspectRatio: undefined })).toEqual({});
|
||||
});
|
||||
|
||||
test('fontVariant', () => {
|
||||
|
||||
@@ -182,7 +182,7 @@ export const preprocess = <T: {| [key: string]: any |}>(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (prop === 'aspectRatio') {
|
||||
if (prop === 'aspectRatio' && typeof value === 'number') {
|
||||
nextStyle[prop] = value.toString();
|
||||
} else if (prop === 'fontVariant') {
|
||||
if (Array.isArray(value) && value.length > 0) {
|
||||
|
||||
@@ -188,7 +188,7 @@ export type LayoutStyles = {|
|
||||
| 'flex-start'
|
||||
| 'stretch'
|
||||
),
|
||||
aspectRatio?: ?number,
|
||||
aspectRatio?: ?NumberOrString,
|
||||
backfaceVisibility?: ?VisiblilityValue,
|
||||
borderWidth?: ?DimensionValue,
|
||||
borderBlockWidth?: ?DimensionValue,
|
||||
|
||||
Reference in New Issue
Block a user