File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -313,12 +313,12 @@ export default class Tree extends React.Component {
313
313
. children ( d => ( d . _collapsed ? null : d . _children ) ) ;
314
314
315
315
const rootNode = this . state . data [ 0 ] ;
316
- const nodes = tree . nodes ( rootNode ) ;
317
- const links = tree . links ( nodes ) ;
316
+ let nodes = tree . nodes ( rootNode ) ;
318
317
319
318
// set `initialDepth` on first render if specified
320
319
if ( initialDepth !== undefined && this . internalState . initialRender ) {
321
320
this . setInitialTreeDepth ( nodes , initialDepth ) ;
321
+ nodes = tree . nodes ( rootNode ) ;
322
322
}
323
323
324
324
if ( depthFactor ) {
@@ -327,6 +327,7 @@ export default class Tree extends React.Component {
327
327
} ) ;
328
328
}
329
329
330
+ const links = tree . links ( nodes ) ;
330
331
return { nodes, links } ;
331
332
}
332
333
You can’t perform that action at this time.
0 commit comments