Tailwind Object-fit doesn't function

731 Views Asked by At

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.

1

There are 1 best solutions below

0
On

Just use resizeMode: 'contain'