oblador / react-native-animatable

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

Typings error #209

Open FRizzonelli opened 6 years ago

FRizzonelli commented 6 years ago

Hello, I'm on TS 3.0 version and RN 0.56 (updated yesterday), latest release of RN-animatable

I'm receiving this error on the direction property of an Image (before update working fine)

Type 'string' is not assignable to type 'undefined'.

My current TSX (smallScale is a custom animation, but I've the same error even with standard animations)

<Image
  source={loaderShadow}
  resizeMode="center"
  animation="smallScale"
  useNativeDriver={true}
  iterationCount="infinite"
  duration={250}
  direction="alternate"
 />

Any clue on this? I'm usually fine at fixing typings, but this one for me is really awkward :(

EDIT: I've found the problem, Type definitions for react-native 0.56 introduce a property for FlexStyle only on iOS named direction.

    /**
     * @platform ios
     */
    direction?: "inherit" | "ltr" | "rtl"

ImageStyle extends FlexStyle of course, so the property name is colliding and TS is complaining about it. Any idea on how this could be fixed?

FRizzonelli commented 6 years ago

Any news on this? It's kind of annoying to have my linter complaining about that