You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When expanding or collapsing nodes (also selecting etc.) nodes in the basic tree demo (https://primereact.org/tree/#basic) new UITreeNode will be created even for nodes which are not expanded/collapsed.
This is no problem for small trees, but adds significant rendering time in case of larger trees (e.g. 1000 root nodes).
Describe the bug
When expanding or collapsing nodes (also selecting etc.) nodes in the basic tree demo (https://primereact.org/tree/#basic) new UITreeNode will be created even for nodes which are not expanded/collapsed.
This is no problem for small trees, but adds significant rendering time in case of larger trees (e.g. 1000 root nodes).
Reproducer
https://stackblitz.com/edit/z6evqupr?file=src%2FApp.jsx
System Information
System: OS: Windows 11 10.0.26100 CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1270P Memory: 9.90 GB / 31.70 GB Binaries: Node: 24.14.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.21 - C:\Users\lgr9fe\AppData\Roaming\npm\yarn.CMD npm: 11.6.3 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 148.0.7778.179 Edge: Chromium (144.0.3719.92) Firefox: 140.11.0 - C:\Program Files\Mozilla Firefox\firefox.exe Internet Explorer: 11.0.26100.8115 npmPackages: primereact: latest => 10.9.8 react: 18.3.1 => 18.3.1Steps to reproduce the behavior
Expected behavior
UITreeNode should be only re-created / re-rendered if necessary (children expanded/collapsed, label changed, ...).