Tailwind Object-fit doesn't function

714 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 answers

0
noone On

Just use resizeMode: 'contain'