-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Steps to reproduce
Steps:
- Open this link to live example: (required)
- Click update button (it updates react query data cache)
- Observe, nothing happens.
Current behavior
On data source change, the tree is not re-rendered
Expected behavior
On data source change, it should update items
Context
I have this RichTreeViewPro component where I lazy-load items from backend (with react query). The problem is that I need to do updates (for root items) and show/hide them real time from the tree-view.
The problem is that when I change the data in the backend and refetch the root items, the treeview doesn't re-render.
Maybe this is expected behavior for performance issues, but I dont understand how is this supposed to work.
For example with Data Grid even for lazy loading you can refetch the data and it re renders, but in this example I cannot find a solution, except providing a key={treeViewKey} and updating it everytime the data changes (force re-render)
Your environment
npx @mui/envinfo
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
Search keywords: RichTreeViewPro, re-render
Order ID: 108277