oblador / react-native-animatable

Standard set of easy to use animations and declarative transitions for React Native
MIT License
9.84k stars 702 forks source link

Typescript error on animation prop #251

Open Kouznetsov opened 5 years ago

Kouznetsov commented 5 years ago

AnimatableProperties' animation prop is described as Animation | string in react-native-animatable.d.ts. Passing a custom animation object then displays a typescript "Type X is not assignable to string" error.

I could make a PR adding

interface AnimatableProperties<S extends {}> {
    animation?: Animation | string | object; //<- that
    ...

But it's kind of a quick fix without true robustness. Should we add field checking to assure that at least 0 and 1 are present, and that each field has properties shared from react-native's ViewStyle ? Or would a | object be enough ?

Thanks for the great library btw 👍