react-resizable icon indicating copy to clipboard operation
react-resizable copied to clipboard

React 18 support?

Open Okrekso opened this issue 3 years ago • 1 comments

  • [ ] 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

Okrekso avatar May 17 '22 11:05 Okrekso

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

vkmita avatar May 18 '22 08:05 vkmita