oblador / react-native-animatable

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

transition rotate type error #302

Open Grewer opened 4 years ago

Grewer commented 4 years ago

dep:

"react-native-animatable": "^1.3.3"

RN latest definition: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-native/index.d.ts

when I use:

<Animatable.View style={{ transform: [{ rotate: `${rotation}deg` }] }}  transition="rotate">
            <Icon name="up" color="#9B9B9B" size={16} />
</Animatable.View>

Although transition =" rotate " gives an error, it still runs successfully

I looked at the definition: transition:

transition = keyof ViewStyle 
// =>
interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle{}
interface TransformsStyle {
    transform?: (
        RotateTransform
        | RotateXTransform
        | RotateYTransform
        | RotateZTransform)[];
    rotation?: number;
}
// Omitted some definitions

transition ="rotate" will only report an error if it is transition ="rotation", but it will not run