'Tailwind Object-fit doesn't function

When trying to use object-contain in tailwind I get Warning: Failed prop type: Invalid props.style key `object-fit` supplied to `Image`.

This is my code <Image style={[tw`flex object-contain bg-red-400`, {width: '100%', height: '50%'}]} source={{uri: card.image}}/> BTW tried without width and height still doesn't work.



Solution 1:[1]

Just use resizeMode: 'contain'

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 george raytchinov