Open
Description
To reproduce, run the type checker with the new React version, e.g. like this:
- Fork this repo
- Change to react v19 in package.json, especially the typings:
"@types/react": "^19.0.1", "@types/react-dom": "^19.0.1", "react": "^19.0.0", "react-dom": "^19.0.0", "react-frame-component": "^5.2.6", "react-test-renderer": "^19.0.0",
npm update
,cd typings
../node_modules/typescript/bin/tsc
While it worked fine with the older React version, now it throws this error:
test.tsx:33:5 - error TS2322: Type 'RefObject<HTMLDivElement | null>' is not assignable to type 'RefObject<HTMLElement>'.
Type 'HTMLDivElement | null' is not assignable to type 'HTMLElement'.
Type 'null' is not assignable to type 'HTMLElement'.
33 nodeRef={nodeRef}
~~~~~~~
index.d.ts:53:5
53 nodeRef?: React.RefObject<HTMLElement>,
~~~~~~~
The expected type comes from property 'nodeRef' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Draggable> & Pick<Readonly<Partial<DraggableProps>>, never> & InexactPartial<...> & InexactPartial<...>'
Metadata
Metadata
Assignees
Labels
No labels