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
When trying to use the HTMLView component, TypeScript throws the following error:
TS2786: 'HTMLView' cannot be used as a JSX component.
Its type 'ComponentType<HTMLViewProps>' is not a valid JSX element type.
Type 'ComponentClass<HTMLViewProps, any>' is not assignable to type 'ElementType'.
Type 'ComponentClass<HTMLViewProps, any>' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component<any, any, any>'.
Property 'refs' is missing in type 'Component<HTMLViewProps, any, any>' but required in type 'Component<any, any, any>'.
55 <HTMLView
~~~~~~~~
node_modules/@types/react/index.d.ts:1021:9
1021 refs: {
~~~~
'refs' is declared here.
A workaround was presented for pnpm by utilizing the overrides field. For yarn, you can achieve a similar fix by adding the same version of @types/react from your devDependencies to the resolutions field in your package.json:
"resolutions": {
"@types/react": "~18.2.45"
}
The text was updated successfully, but these errors were encountered:
When trying to use the
HTMLView
component, TypeScript throws the following error:This issue is essentially the same as the one described in this discussion from another package: DefinitelyTyped/DefinitelyTyped#71404
A workaround was presented for
pnpm
by utilizing the overrides field. Foryarn
, you can achieve a similar fix by adding the same version of@types/react
from yourdevDependencies
to theresolutions
field in yourpackage.json
:The text was updated successfully, but these errors were encountered: