All UITreeNode re-rendered when expanding/collapsing nodes
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- react
- Domain
- frontend
Research direction
Start by running the Lazy Tree demo and the linked StackBlitz reproducer, then inspect the tree component and UITreeNode rendering behavior. The fix is complete when expanding Node 1 does not recreate or rerender unaffected nodes such as Node 0, while necessary updates still occur for expanded, collapsed, or changed nodes.
Written by the indexing model from the issue text.
Description
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.1
Steps to reproduce the behavior
- Run Lazy Tree demo https://primereact.org/tree/#lazy
- Observe new UITreeNode will be created for Node 0 when expanding Node 1
Expected behavior
UITreeNode should be only re-created / re-rendered if necessary (children expanded/collapsed, label changed, ...).
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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.
More from primefaces/primereact
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8552 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
primefaces/primereact#8550 ·
-
Row checkbox selection tick is invisible in Landing Page Theme sectionPossibly taken @Prakash1185 claimed this 172 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
primefaces/primereact#8545 ·
-
Dependency conflict between jspdf v4 and jspdf-autotable during npm installPossibly taken @Kamran92 claimed this 187 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8537 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
primefaces/primereact#8551 ·
All issues in primefaces/primereact
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
eclipse-tradista/tradista#371 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
devswha/herdr-web-ui#4457 ·
-
bug ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
userFRM/egui-charts#4068 ·
Maintainers usually reply within 1 day