lukasbach/react-complex-tree

Performance and rendering issues with custom TreeDataProviders

Closed this issue · 1 comments

Describe the bug
TreeDataProvider implementations have their 'getItem' method called excessively. Also, items returned from those calls do not render.

To Reproduce
Steps to reproduce the behavior (ideally a codesandbox link or similar if for a library issue):

https://app.coderpad.io/EED2HTQW

Please note that this code is lifted from the CustomDataProvider documentation and the Storybook for the feature.

Note that the CustomDataProviderImplementation getItem method writes a message to console, and that it's being called excessively. It is also returning the item to render but no item rendering is occuring.

Note that adding any item dynamically does not work.

Expected behavior
getItem should not be called excessively, and the items returned by it should be rendered.

Screenshots
If applicable, add screenshots to help explain your problem. A gif or screencast can also help understand your problem.

Additional context
You can help by providing additional details that are available to you, such as

  • Device if mobile
  • Operating System, Browser: Mac OSX, Chrome
  • Version of the Library or tool for which you report the bug: 2.4.5

This was caused by my misunderstanding of the API, fixed and not a bug.