loadData promise will be triggered twice if it's been rejected directly without appending child nodes.
Hey mate, I can reproduce this issue in the following sandbox. Can anyone help take a look at this?
https://codesandbox.io/s/gallant-darkness-c8uvw?file=/App.jsx:1953-1954 You can see that console will print out two batches of message in loadData callback.
Coz I'm trying to refresh a tree node for my next trial when some metadata is ready in the backend. So I reject the promise in loadData. However, this will trigger this callback twice, so does the real requesting body.
I've checked rc-tree's implementation, it's purely resulted from TreeNode's syncLoadData. It'll retrigger onNodeLoad if no children is detected on itself meanwhile it's not loaded.
Can we optimize its mechanism a bit?
Currently, I have to put a fake or placeholder like data after asynchronous call is ended. So that this loading promise won't be triggered twice.