nandorojo / dripsy

🍷 Responsive, unstyled UI primitives for React Native + Web.
https://dripsy.xyz
MIT License
2.01k stars 80 forks source link

styled method aspectRatio property type invalid #132

Closed demic-dev closed 2 years ago

demic-dev commented 2 years ago

Hi!

When you declare a component with the styled method and you give them styling, aspectRatio property is set as string, but React Native requires a number.

Screenshot 2021-10-15 at 22 55 28

Workaround

Commenting the line before with @ts-ignore can avoid the problem. Example:

const Image = styled(Image)({
  width: 300px,
  // @ts-ignore
  aspectRatio: 1
});
nandorojo commented 2 years ago

Could you try upgrading to v3

yarn add dripsy@canary

it comes with a ton of types improvements, maybe this one is fixed too…

nandorojo commented 2 years ago

See more at https://github.com/nandorojo/dripsy/pull/124

demic-dev commented 2 years ago

Yes, with the latest version is working fine, thanks for the quick response!

nandorojo commented 2 years ago

Cool