Gabriel Donadel Dall'Agnol
|
14c91cdf59
|
feat: Add string support for aspectRatio (#34629)
Summary:
This updates `aspectRatio` to support string values and ratio formats, i.e., `'16 / 9'`, thus aligning it with the [CSS Box Sizing Module Level 4](https://drafts.csswg.org/css-sizing-4/#aspect-ratio) specification as requested on https://github.com/facebook/react-native/issues/34425. This also adds unit tests to the `processAspectRatio` function ensuring the style processing works as expected.
## Changelog
[General] [Added] - Add string support for aspectRatio
Pull Request resolved: https://github.com/facebook/react-native/pull/34629
Test Plan:
This can be tested either through `processAspectRatio-tests` or by using the following code:
```js
<View
style={{
backgroundColor: '#527FE4',
aspectRatio: '16 / 9',
}} />
```
https://user-images.githubusercontent.com/11707729/189029904-da1dc0a6-85de-46aa-8ec2-3567802c8719.mov
Reviewed By: jacdebug
Differential Revision: D39423304
Pulled By: cipolleschi
fbshipit-source-id: d323de93d6524e411e7ab9943335a8ca323b6e61
|
2022-09-27 04:05:52 -07:00 |
|