@@ -163,13 +163,11 @@ class ReactSortableTree extends Component {
163
163
164
164
this . props . onChange ( treeData ) ;
165
165
166
- if ( this . props . onVisibilityToggle ) {
167
- this . props . onVisibilityToggle ( {
168
- treeData,
169
- node : targetNode ,
170
- expanded : ! targetNode . expanded ,
171
- } ) ;
172
- }
166
+ this . props . onVisibilityToggle ( {
167
+ treeData,
168
+ node : targetNode ,
169
+ expanded : ! targetNode . expanded ,
170
+ } ) ;
173
171
}
174
172
175
173
moveNode ( {
@@ -190,18 +188,16 @@ class ReactSortableTree extends Component {
190
188
191
189
this . props . onChange ( treeData ) ;
192
190
193
- if ( this . props . onMoveNode ) {
194
- this . props . onMoveNode ( {
195
- treeData,
196
- node,
197
- treeIndex,
198
- path,
199
- nextPath : path ,
200
- nextTreeIndex : treeIndex ,
201
- prevPath,
202
- prevTreeIndex,
203
- } ) ;
204
- }
191
+ this . props . onMoveNode ( {
192
+ treeData,
193
+ node,
194
+ treeIndex,
195
+ path,
196
+ nextPath : path ,
197
+ nextTreeIndex : treeIndex ,
198
+ prevPath,
199
+ prevTreeIndex,
200
+ } ) ;
205
201
}
206
202
207
203
search (
@@ -334,7 +330,6 @@ class ReactSortableTree extends Component {
334
330
const treeData = this . state . draggingTreeData || this . props . treeData ;
335
331
this . props . onChange ( treeData ) ;
336
332
337
- if ( this . props . onMoveNode ) {
338
333
this . props . onMoveNode ( {
339
334
treeData,
340
335
node,
@@ -682,9 +677,9 @@ ReactSortableTree.defaultProps = {
682
677
isVirtualized : true ,
683
678
maxDepth : null ,
684
679
nodeContentRenderer : NodeRendererDefault ,
680
+ onMoveNode : ( ) => { } ,
681
+ onVisibilityToggle : ( ) => { } ,
685
682
placeholderRenderer : PlaceholderRendererDefault ,
686
- onMoveNode : null ,
687
- onVisibilityToggle : null ,
688
683
reactVirtualizedListProps : { } ,
689
684
rowHeight : 62 ,
690
685
scaffoldBlockPxWidth : 44 ,
0 commit comments