react-component / tree

React Tree

Home Page:https://tree.react-component.now.sh/

Repository from Github https://github.comreact-component/treeRepository from Github https://github.comreact-component/tree

Add `onLoadError` to handle error load

JialuGong opened this issue · comments

If there is a loading error and the user has set loadedKeys , onLoad cannot handle this situation and may cause infinity loop. Following is an example

Edit eloquent-feistel-7rmyb3

I notice onLoad function only be called when the promise is fulfilled. And the user can only cope with loadedKeys in loadData function when there is a loading error.

I wonder if it is possible to add an onLoadError prop to handler loading error situation, which is just like following

https://github.com/JialuGong/tree/blob/454c4de5639f8c00d9105017676403866162ea9b/src/Tree.tsx#L998-L1009