react-component / react-component/tree
Add `onLoadError` to handle error load
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 490
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 5
Description
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
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced Tree.tsx lines 998-1009 and reproduce the loading-error case in the linked CodeSandbox, focusing on loadedKeys, loadData, and onLoad. Done means the loading error can be handled through the proposed onLoadError prop without causing an infinite loop, with behavior matching the documented example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100