SrBrahma / react-native-shadow-2

Cross-platform shadow for React Native. Supports Android, iOS, Web, and Expo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The offset and size properties are of the wrong type.

tuxsnct opened this issue · comments

I don't think TypeScript allows you to specify keys and their types for arrays, but the source code does.

I think it would be better to modify the ShadowProps interface like this:

interface ShadowProps {
  // ...
  offset?: (number | string)[];
  // ...
  size?: number[];
  // ...
}

Alternatively, you can use the key as follows (not recommended for compatibility reasons):

interface ShadowProps {
  // ...
  offset?: { x: number | string, y: number | string };
  // ...
  size?: { width: number, height: number };
  // ...
}
commented

Hi @tuxsnct! This TS functionality is available since V4, released a year ago. Please, update your typescript version! 🤓

Oops, looks like it.
Thanks!