ITADN

React 19 deprecation warning: `InternalMosaicWindow2` accesses `element.ref`

#225Openprintfn 创建于 2025-02-12
P
printfncommented
I'm seeing this deprecation warning when using React 19: ``` Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release. Component Stack: InternalMosaicWindow2 MosaicWindow.tsx:64 ConnectedInternalMosaicWindow MosaicWindow.tsx:260 MosaicWindow2 react-mosaic-component.js:8857 div unknown:0 div unknown:0 MosaicRoot2 MosaicRoot.tsx:15 div unknown:0 MosaicWithoutDragDropContext2 react-mosaic-component.js:7861 DndProvider2 DndProvider.tsx:28 Mosaic2 react-mosaic-component.js:7994 ``` It would probably make sense to access `element.props.ref` and fall back to `element.ref` if that doesn't exist.
9 条评论