Feature Request: add isDragging and isDropTarget node properties
Nerevar123 opened this issue · comments
Add props isDragging and isDropTarget - like 'dropable' prop, which show the current state of a node if it is a drop target or on dragging.
This will add the ability to style a specific node, not a whole sub-tree, like with current classes draggingSource and dropTarget.
Asking about props because I`m using styled-components in a project, but classes will help as well :)
@Nerevar123 Thank you for the feature request!
I've released an alpha version that adds two flags isDragging
and isDropTarget
to the option passed to the render callback. You can install it with the following command
npm install @minoru/react-dnd-treeview@alpha
You can use it as shown in the sample below.
https://codesandbox.io/s/issue-82-y5mb6?file=/src/App.jsx
Try it out. If there are no problems, I will include it in the next release (v1.6.0).
I tried it, works great.
Thank you!