react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

transition rotate type error

Open Grewer opened this issue 5 years ago • 0 comments

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

Grewer avatar Feb 17 '20 12:02 Grewer