We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f57134 commit d5f8e0fCopy full SHA for d5f8e0f
src/TreeNode.jsx
@@ -276,7 +276,7 @@ class TreeNode extends React.Component {
276
277
// Load data to avoid default expanded tree without data
278
syncLoadData = (props) => {
279
- const { expanded, loading } = props;
+ const { expanded, loading, loaded } = props;
280
const { rcTree: { onNodeLoad } } = this.context;
281
282
if (loading) return;
@@ -286,7 +286,7 @@ class TreeNode extends React.Component {
286
// We needn't reload data when has children in sync logic
287
// It's only needed in node expanded
288
const hasChildren = this.getNodeChildren().length !== 0;
289
- if (!hasChildren) {
+ if (!hasChildren && !loaded) {
290
onNodeLoad(this);
291
}
292
0 commit comments