Description
react-native 0.71.9 and 0.71.10 were published today and the typings are now broken probably because of this PR. Downgrading react-native@0.71.8 eliminates the issue.
diffs: 0.71.8..0.71.9 and 0.71.9..0.71.10
TS2344: Type 'ViewStyle' does not satisfy the constraint 'AnimatedStyleProp<ViewStyle | TextStyle | ImageStyle>'. Type 'ViewStyle' is not assignable to type 'AnimateStyle<TextStyle>'. Types of property 'transform' are incompatible. Type 'string | (PerpectiveTransform | RotateTransform | RotateXTransform | RotateYTransform | RotateZTransform | ... 7 more ... | MatrixTransform)[] | undefined' is not assignable to type 'AnimatedTransform | undefined'.

TS2345: Argument of type '() => { transform: { translateY: number; }[]; opacity: number; zIndex: number; }' is not assignable to parameter of type '() => AnimatedStyleProp<ViewStyle | TextStyle | ImageStyle>'. Type '{ transform: { translateY: number; }[]; opacity: number; zIndex: number; }' is not assignable to type 'AnimatedStyleProp<ViewStyle | TextStyle | ImageStyle>'. Type '{ transform: { translateY: number; }[]; opacity: number; zIndex: number; }' is not assignable to type 'AnimateStyle<ImageStyle>'. Types of property 'transform' are incompatible. Type '{ translateY: number; }[]' is not assignable to type 'never[]'. Type '{ translateY: number; }' is not assignable to type 'never'.

const input = useRef<TextInput>(null); produces this on const AnimatedTextInput = Animated.createAnimatedComponent(TextInput); while using "@types/react": "18.2.7":
TS2769: No overload matches this call. Overload 1 of 2, '(props: { value?: string | SharedValue<string | undefined> | undefined; id?: string | SharedValue<string | undefined> | undefined; children?: ReactNode | SharedValue<...>; ... 148 more ...; sharedTransitionStyle?: ILayoutAnimationBuilder | undefined; } & { ...; } & { ...; }): ReactElement<...>', gave the following error. Type 'RefObject<TextInput>' is not assignable to type 'Ref<Component<AnimateProps<TextInputProps>, any, any>> | undefined'. Type 'RefObject<TextInput>' is not assignable to type 'RefObject<Component<AnimateProps<TextInputProps>, any, any>>'. Type 'TextInput' is not assignable to type 'Component<AnimateProps<TextInputProps>, any, any>'. The types of 'props.style' are incompatible between these types. Type 'StyleProp<TextStyle>' is not assignable to type 'StyleProp<AnimateStyle<StyleProp<TextStyle>>>'. Type 'TextStyle' is not assignable to type 'StyleProp<AnimateStyle<StyleProp<TextStyle>>>'. Type 'TextStyle' is not assignable to type 'AnimateStyle<TextStyle>'. Overload 2 of 2, '(props: StyledComponentPropsWithAs<ComponentClass<AnimateProps<TextInputProps>, any>, { announcements: { title: string; date: string; }; introductionDialog: { overlayColor: string; }; ... 105 more ...; walkthrough_dialogs: { ...; }; }, {}, never, ComponentClass<...>, ComponentClass<...>>): ReactElement<...>', gave the following error. Type 'RefObject<TextInput>' is not assignable to type 'Ref<Component<AnimateProps<TextInputProps>, any, any>> | undefined'. index.d.ts(146, 9): The expected type comes from property 'ref' which is declared here on type 'IntrinsicAttributes & { value?: string | SharedValue<string | undefined> | undefined; id?: string | SharedValue<string | undefined> | undefined; ... 149 more ...; sharedTransitionStyle?: ILayoutAnimationBuilder | undefined; } & { ...; } & { ...; }' index.d.ts(146, 9): The expected type comes from property 'ref' which is declared here on type 'IntrinsicAttributes & { value?: string | SharedValue<string | undefined> | undefined; id?: string | SharedValue<string | undefined> | undefined; ... 149 more ...; sharedTransitionStyle?: ILayoutAnimationBuilder | undefined; } & { ...; } & { ...; }'

Steps to reproduce
- update react-native@0.71.9+
Snack or a link to a repository
none needed
Reanimated version
3.2.0
React Native version
0.71.9+
Platforms
Android, iOS, Web
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
Description
react-native
0.71.9and0.71.10were published today and the typings are now broken probably because of this PR. Downgrading react-native@0.71.8 eliminates the issue.diffs: 0.71.8..0.71.9 and 0.71.9..0.71.10
const input = useRef<TextInput>(null);produces this onconst AnimatedTextInput = Animated.createAnimatedComponent(TextInput);while using"@types/react": "18.2.7":Steps to reproduce
Snack or a link to a repository
none needed
Reanimated version
3.2.0
React Native version
0.71.9+
Platforms
Android, iOS, Web
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes