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 };
// ...
}
Hi @tuxsnct! This TS functionality is available since V4, released a year ago. Please, update your typescript version! 🤓
It's called labeled tuple: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements
Oops, looks like it.
Thanks!