Skip to content

Commit 5f29231

Browse files
committed
Apply extra properties inside the default node renderer
1 parent c191be7 commit 5f29231

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-sortable-tree",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Drag-and-drop sortable representation of hierarchical data",
55
"scripts": {
66
"build": "npm run lint && npm run test && npm run build:demo && npm run build:umd",

src/node-renderer-default.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const NodeRendererDefault = ({
3232
buttons,
3333
className,
3434
style = {},
35+
startDrag: _startDrag,
36+
endDrag: _endDrag,
37+
...otherProps,
3538
}) => {
3639
let handle;
3740
if (typeof node.children === 'function' && node.expanded) {
@@ -65,7 +68,10 @@ const NodeRendererDefault = ({
6568
const isDraggedDescendant = draggedNode && isDescendant(draggedNode, node);
6669

6770
return (
68-
<div style={{ height: '100%' }}>
71+
<div
72+
style={{ height: '100%' }}
73+
{...otherProps}
74+
>
6975
{toggleChildrenVisibility && node.children && node.children.length > 0 && (
7076
<div>
7177
<button
@@ -157,6 +163,8 @@ NodeRendererDefault.propTypes = {
157163
// Drag source
158164
connectDragPreview: PropTypes.func.isRequired,
159165
connectDragSource: PropTypes.func.isRequired,
166+
startDrag: PropTypes.func.isRequired, // Needed for drag-and-drop utils
167+
endDrag: PropTypes.func.isRequired, // Needed for drag-and-drop utils
160168
isDragging: PropTypes.bool.isRequired,
161169
draggedNode: PropTypes.object,
162170
// Drop target

0 commit comments

Comments
 (0)