diff --git a/src/node-renderer-default.js b/src/node-renderer-default.js
index 987c1797..608f4bfd 100644
--- a/src/node-renderer-default.js
+++ b/src/node-renderer-default.js
@@ -1,4 +1,4 @@
-import React, { PropTypes } from 'react';
+import React, { Component, PropTypes } from 'react';
import { getIEVersion } from './utils/browser-utils';
import baseStyles from './node-renderer-default.scss';
import { isDescendant } from './utils/tree-data-utils';
@@ -15,139 +15,143 @@ if (getIEVersion < 10) {
};
}
-const NodeRendererDefault = ({
- scaffoldBlockPxWidth,
- toggleChildrenVisibility,
- connectDragPreview,
- connectDragSource,
- isDragging,
- canDrop,
- node,
- draggedNode,
- path,
- treeIndex,
- isSearchMatch,
- isSearchFocus,
- buttons,
- className,
- style = {},
- didDrop,
- isOver: _isOver, // Not needed, but preserved for other renderers
- parentNode: _parentNode, // Needed for drag-and-drop utils
- endDrag: _endDrag, // Needed for drag-and-drop utils
- startDrag: _startDrag, // Needed for drag-and-drop utils
- ...otherProps,
-}) => {
- let handle;
- if (typeof node.children === 'function' && node.expanded) {
- // Show a loading symbol on the handle when the children are expanded
- // and yet still defined by a function (a callback to fetch the children)
- handle = (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- } else {
- // Show the handle used to initiate a drag-and-drop
- handle = connectDragSource((
-
- ), { dropEffect: 'copy' });
- }
+class NodeRendererDefault extends Component {
+ render() {
+ const {
+ scaffoldBlockPxWidth,
+ toggleChildrenVisibility,
+ connectDragPreview,
+ connectDragSource,
+ isDragging,
+ canDrop,
+ node,
+ draggedNode,
+ path,
+ treeIndex,
+ isSearchMatch,
+ isSearchFocus,
+ buttons,
+ className,
+ style = {},
+ didDrop,
+ isOver: _isOver, // Not needed, but preserved for other renderers
+ parentNode: _parentNode, // Needed for drag-and-drop utils
+ endDrag: _endDrag, // Needed for drag-and-drop utils
+ startDrag: _startDrag, // Needed for drag-and-drop utils
+ ...otherProps,
+ } = this.props;
- const isDraggedDescendant = draggedNode && isDescendant(draggedNode, node);
- const isLandingPadActive = !didDrop && isDragging;
+ let handle;
+ if (typeof node.children === 'function' && node.expanded) {
+ // Show a loading symbol on the handle when the children are expanded
+ // and yet still defined by a function (a callback to fetch the children)
+ handle = (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ } else {
+ // Show the handle used to initiate a drag-and-drop
+ handle = connectDragSource((
+
+ ), { dropEffect: 'copy' });
+ }
- return (
-
- {toggleChildrenVisibility && node.children && node.children.length > 0 && (
-
-