react-dnd: useDrag previewRef does not work when wrapped in
Describe the bug
When using React’s <StrictMode />, the previewRef from useDrag does not work, the preview is still only what the dragRef is.
Reproduction
https://codesandbox.io/s/infallible-oskar-0y8sni
Steps to reproduce the behavior:
- Drag the green box
Expected behavior The entire element with the text and border should not in the drag preview, not just the green handle box.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MocOS 11.6
- Browser: Chrome
- Version: 100.0.4896.127 (Official Build) (x86_64)
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 18
- Comments: 15
Hello, I am experiencing the same issue. Do you know if there is a better workaround than disabling strict mode? Or if there is a plan for a fix?
I have the same issue, but limited to the first attempt to drag:
The issue goes away when I disable StrictMode, and luckily in the production build the StrictMode checks are disabled by default, but is pretty annoying during development.
+1
The problem still exists