You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from reanimated 1.13 to 2.2 I'm getting the following typescript error:
TS2769: No overload matches this call. Overload 1 of 2, '(component: ComponentClass<FastImageProps, any>, options?: Options<FastImageProps> | undefined): ComponentClass<AnimateProps<FastImageProps>, any>', gave the following error. Argument of type 'ComponentType<FastImageProps> & FastImageStaticProperties' is not assignable to parameter of type 'ComponentClass<FastImageProps, any>'. Type 'FunctionComponent<FastImageProps> & FastImageStaticProperties' is not assignable to type 'ComponentClass<FastImageProps, any>'. Type 'FunctionComponent<FastImageProps> & FastImageStaticProperties' provides no match for the signature 'new (props: FastImageProps, context?: any): Component<FastImageProps, any, any>'. Overload 2 of 2, '(component: FunctionComponent<FastImageProps>, options?: Options<FastImageProps> | undefined): FunctionComponent<AnimateProps<FastImageProps>>', gave the following error. Argument of type 'ComponentType<FastImageProps> & FastImageStaticProperties' is not assignable to parameter of type 'FunctionComponent<FastImageProps>'. Type 'ComponentClass<FastImageProps, any> & FastImageStaticProperties' is not assignable to type 'FunctionComponent<FastImageProps>'. Type 'ComponentClass<FastImageProps, any> & FastImageStaticProperties' provides no match for the signature '(props: PropsWithChildren<FastImageProps>, context?: any): ReactElement<any, any> | null'.
My code looks like this:
import FastImage from 'react-native-fast-image'
import Reanimated from 'react-native-reanimated'
const AnimatedImage = Reanimated.createAnimatedComponent(FastImage) // the error happens on this line
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
After upgrading from reanimated
1.13
to2.2
I'm getting the following typescript error:TS2769: No overload matches this call. Overload 1 of 2, '(component: ComponentClass<FastImageProps, any>, options?: Options<FastImageProps> | undefined): ComponentClass<AnimateProps<FastImageProps>, any>', gave the following error. Argument of type 'ComponentType<FastImageProps> & FastImageStaticProperties' is not assignable to parameter of type 'ComponentClass<FastImageProps, any>'. Type 'FunctionComponent<FastImageProps> & FastImageStaticProperties' is not assignable to type 'ComponentClass<FastImageProps, any>'. Type 'FunctionComponent<FastImageProps> & FastImageStaticProperties' provides no match for the signature 'new (props: FastImageProps, context?: any): Component<FastImageProps, any, any>'. Overload 2 of 2, '(component: FunctionComponent<FastImageProps>, options?: Options<FastImageProps> | undefined): FunctionComponent<AnimateProps<FastImageProps>>', gave the following error. Argument of type 'ComponentType<FastImageProps> & FastImageStaticProperties' is not assignable to parameter of type 'FunctionComponent<FastImageProps>'. Type 'ComponentClass<FastImageProps, any> & FastImageStaticProperties' is not assignable to type 'FunctionComponent<FastImageProps>'. Type 'ComponentClass<FastImageProps, any> & FastImageStaticProperties' provides no match for the signature '(props: PropsWithChildren<FastImageProps>, context?: any): ReactElement<any, any> | null'.
My code looks like this:
Does anyone now how can I fix this?
Beta Was this translation helpful? Give feedback.
All reactions