I have tried to upgrade to react 19 (and expo 53) in my project and I now get errors when I try to use the ReactNativeZoomableView component:
'ReactNativeZoomableView' cannot be used as a JSX component.
Its type 'typeof ReactNativeZoomableView' is not a valid JSX element type.
Types of construct signatures are incompatible.
Type 'new (props: ReactNativeZoomableViewProps) => ReactNativeZoomableView' is not assignable to type 'new (props: any, context: any) => Component<any, any, any>'.
Construct signature return types 'ReactNativeZoomableView' and 'Component<any, any, any>' are incompatible.
The types returned by 'render()' are incompatible between these types.
Type 'Element' is not assignable to type 'ReactNode'. (ts 2786)
Describe the solution you'd like
No errors, working zoom component.
Describe alternatives you've considered
declare module '@openspacelabs/react-native-zoomable-view' {
import { Component } from 'react'
import { ViewProps } from 'react-native'
export interface ReactNativeZoomableViewProps extends ViewProps {
maxZoom?: number
minZoom?: number
zoomStep?: number
initialZoom?: number
bindToBorders?: boolean
}
export class ReactNativeZoomableView extends Component<ReactNativeZoomableViewProps> {}
}
If I declare my own type like this (in types.d.ts) it works.
Additional context
Im using:
"@openspacelabs/react-native-zoomable-view": "^2.4.2",
"react-native": "0.79.3"
I have tried to upgrade to react 19 (and expo 53) in my project and I now get errors when I try to use the ReactNativeZoomableView component:
'ReactNativeZoomableView' cannot be used as a JSX component.
Its type 'typeof ReactNativeZoomableView' is not a valid JSX element type.
Types of construct signatures are incompatible.
Type 'new (props: ReactNativeZoomableViewProps) => ReactNativeZoomableView' is not assignable to type 'new (props: any, context: any) => Component<any, any, any>'.
Construct signature return types 'ReactNativeZoomableView' and 'Component<any, any, any>' are incompatible.
The types returned by 'render()' are incompatible between these types.
Type 'Element' is not assignable to type 'ReactNode'. (ts 2786)
Describe the solution you'd like
No errors, working zoom component.
Describe alternatives you've considered
If I declare my own type like this (in types.d.ts) it works.
Additional context
Im using:
"@openspacelabs/react-native-zoomable-view": "^2.4.2",
"react-native": "0.79.3"