react-resizable
react-resizable copied to clipboard
React 18 support?
- [ ] Bug
- [ ] Feature Request
- [x] Question
Problem Report
I'm updating my project to React 18 because it's released now. My project using react-resizable and I'm getting such errors now when I'm trying to drag something.
Uncaught Error: <DraggableCore> not mounted on DragStart!
System Info
Node Version: 16.14.2 Browser: Chrome OS: Windows
Reproduction
Use React 18 and add some draggable things
Figured out my specific issue. I ran into this exception when I didn't pass a ref into my custom drag handle components.
<ResizableBox
...
handle={(resizeHandle, ref) => <div ref={ref}>{resizeHandle}</div>}
>
<div />
</ResizableBox>
This ref parameter is not part of the current ts types. I put up a PR to add them to @types/react-resizable here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60405