react-component / react-component/tree

Rc-Tree not using defaultExpandedKeys properly

Open
#405 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
490
Avg merge
3d 17h
Merged PRs (30d)
5

Description

Greetings.
I've got rc-tree implemented where data is loaded from a server and selected/expanded nodes are persisted across page loads. The selection part works just fine, but I've noticed that even though I can use react dev tools to see defaultExpandedKeys set to
["site-2", "area-18", "asset-100"]

If I expand a bunch of nodes and select a node deep in the tree, and then reload page, I can expand those same nodes and see that defaultSelectedKeys is working properly, but defaultExpandedKeys doesnt seem to affect the expanded nodes in the tree itself.

rc-tree version "^4.0.0". Everything is seemingly working amazing.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are identified in the report. Reproduce the issue with server-loaded data and defaultExpandedKeys, then compare its behavior with defaultSelectedKeys. Done means the persisted expanded node keys expand the corresponding nodes after a page reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.