-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[tree view] Update the typing of updateItemChildren() to accept null
#20483
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
[tree view] Update the typing of updateItemChildren() to accept null
#20483
Conversation
noraleonte
commented
Nov 28, 2025
- I have followed (at least) the PR section of the contributing guide.
|
Deploy preview: https://deploy-preview-20483--material-ui-x.netlify.app/ Updated pages: Bundle size report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the updateItemChildren API method in the Tree View component to accept null as a parameter, enabling developers to refresh the entire tree's root children. This is a useful feature for scenarios where the complete tree data needs to be reloaded rather than just a specific item's children.
Key Changes:
- Updated the
updateItemChildrentype signature to acceptTreeViewItemId | nullinstead of justTreeViewItemId - Added comprehensive test coverage for both null and non-null parameter cases
- Updated API documentation to clarify the null parameter behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/x-tree-view/src/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.ts |
Updated type signature and JSDoc for updateItemChildren to accept null parameter |
packages/x-tree-view-pro/src/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.test.tsx |
Added two test cases covering null and itemId parameters for updateItemChildren method |
docs/data/tree-view/rich-tree-view/lazy-loading/lazy-loading.md |
Added inline comment explaining null parameter usage in API documentation |
...ges/x-tree-view/src/internals/plugins/useTreeViewLazyLoading/useTreeViewLazyLoading.types.ts
Outdated
Show resolved
Hide resolved
…ing/useTreeViewLazyLoading.types.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nora <72460825+noraleonte@users.noreply.github.com>
updateItemChildren accept nullupdateItemChildren() to accept null
mui#20483) Signed-off-by: Nora <72460825+noraleonte@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mui#20483) Signed-off-by: Nora <72460825+noraleonte@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>