Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TreeView] Hydration error from 7.19.0 onwards #14980

Closed
gurkerl83 opened this issue Oct 15, 2024 · 2 comments · Fixed by #15002
Closed

[TreeView] Hydration error from 7.19.0 onwards #14980

gurkerl83 opened this issue Oct 15, 2024 · 2 comments · Fixed by #15002
Assignees
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! regression A bug, but worse

Comments

@gurkerl83
Copy link

gurkerl83 commented Oct 15, 2024

Steps to reproduce

Will not provide

Current behavior

The Tree and TreeItem components function as expected up until version @mui/x-tree-view: 7.18.0.

After some investigation, it appears that starting with version 7.19.0, the Tree component now requires a mandatory id attribute for each instance. If this attribute is not supplied, a hydration error occurs. In previous versions, this issue did not arise.

Additionally, we are not using version 2 of the Tree and TreeItem components, which were recently refactored, so we cannot confirm whether this behavior is consistent in those versions.

To avoid confusion, we should update our documentation to reflect this requirement or consider fixing the issue to prevent users from having to investigate the code themselves.

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: No duplicate found

@gurkerl83 gurkerl83 added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 15, 2024
@github-actions github-actions bot added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Oct 15, 2024
@flaviendelangle
Copy link
Member

I can reproduce it, the default id applied differs between server and client due to the double re-rendering in dev mode on client...
It seems to be fixed by #14210, I'll extrated the required changes

@flaviendelangle flaviendelangle removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 17, 2024
@flaviendelangle flaviendelangle self-assigned this Oct 17, 2024
@flaviendelangle flaviendelangle changed the title Tree / TreeItem Hydration error from 7.19.0 onwards [TreeView] Hydration error from 7.19.0 onwards Oct 17, 2024
@flaviendelangle flaviendelangle added regression A bug, but worse and removed bug 🐛 Something doesn't work labels Oct 17, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@gurkerl83 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants