Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

What is the the point of elements prop in Tree component? #617

Unanswered
raspacee asked this question in Q&A
Discussion options

What is its use?

You must be logged in to vote

Replies: 1 comment

Comment options

In Tree component, the elements prop is mainly for internal logic — it’s not used for rendering the UI directly.

It helps with things like:

  • Expanding the right folders when a selectedId is passed (expandSpecificTargetedElements function).
  • Auto-expanding parent folders when a file or folder is selected.
  • Supporting the CollapseButton (expand/collapse all) by keeping track of the full structure.

The actual UI is rendered manually by writing <Folder> and <File> components inside the .

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /