'React Native Web keeps removing `aspectRatio` property from style. How do I prevent thsi?
I'm trying to get react native component to return a View
with an aspect-ratio: 4.3
using:
const component = () => <View style={{aspectRatio: 4 /3}} >{Content}</View>
I've also tried:
const component = () => <View style={{'aspect-ratio: 4 /3}} >{Content}</View>
In both cases the CSS property is removed. Any ideas?
Solution 1:[1]
Just reading this but I think it should be:
const component = () => <View style={{aspectRatio: "4 /3"}} >{Content}</View>
(4/3 must be wrapped in quotes)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | grazianodev |