Use same element as target and source with hooks
See original GitHub issueWhen I use decorators I could use the same element as target and source:
let Node = ({ connectDragSource, connectDropTarget }) => {
return connectDragSource(connectDropTarget(<div/>));
};
Node = compose(
DropTarget(...),
DragSource(...),
);
Could I implement the same behavior with hooks?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
How to target a specific item to toggleClick on using React ...
I'm having a hard time figuring out how to target a specific menus index with React Hooks - currently onClick, it opens ALL...
Read more >The Complete Guide to useRef() and Refs in React
In this post you'll learn how to use React.useRef() hook to create persisted mutable values (also known as references or refs), as well...
Read more >Hooks FAQ - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. This page...
Read more >The last guide to the useEffect Hook you'll ever need
Don't be afraid to use multiple useEffect statements in your component. While useEffect is designed to handle only one concern, you'll sometimes ...
Read more >The Guide to Learning React Hooks (Examples & Tutorials)
Now, let's see how to do the same thing with Hooks, using a functional ... Consumer> tags around the DOM elements that I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A nice working solution for custom component
Sorry, I got some misunderstanding 😃
Solution:
P.S I could send PR with added this to FAQ if needed