question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-dnd doesn't work with Preact

See original GitHub issue

react-dnd doesn’t seem to work with Preact.

I’ve narrowed down the problem to that where React gives connectDragSource(...) a DOM node, Preact gives it a component instead. When the HTML5-Backend of react-dnd then tries to add attributes to the DOM nodes it fails because the component doesn’t have a setAttribute method.

I’m not quite sure what’s causing this, but i’m guessing it’s some API difference. Most things seem to work but when it comes to adding then exceptions are thrown.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
linde12commented, Jan 24, 2017

@developit This looks promising. I haven’t tested it though, but i will try to do it this week and get back to you!

2reactions
developitcommented, Nov 16, 2016

Yup! Refs were a sore spot for sure, this is likely the last of the issues with them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - React DnD - GitHub Pages
To fix this error, find the top-level component in your app. Usually, this is the root route handler. It doesn't have to be...
Read more >
Uncaught Error: Cannot find module 'react/jsx-runtime'
So my setup actually was working. There was somehow a glitch in the symlink. I as able to resolve by running yarn unlink...
Read more >
react-beautiful-dnd - npm
Beautiful and accessible drag and drop for lists with React. Latest version: 13.1.1, last published: 4 months ago.
Read more >
Module not found: Can't resolve 'react/jsx-runtime' | bobbyhadz
Open your terminal in your project's root directory (where your package.json ... with NPM npm install react@latest react-dom@latest # 👇️ ONLY If you...
Read more >
I was researching drag and drop in JS recently ... - Hacker News
I want the "preact" or "day.js" drag and drop library. ... One of the up and coming React DnD projects is https://github.com/clauderic/dnd-kit.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found