-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Remove instance.getTreeItemIdAttribute
#14667
Conversation
Deploy preview: https://deploy-preview-14667--material-ui-x.netlify.app/ |
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.
Great work! 🚀
@@ -23,8 +10,19 @@ export interface UseTreeViewIdParameters { | |||
|
|||
export type UseTreeViewIdDefaultizedParameters = UseTreeViewIdParameters; | |||
|
|||
export interface UseTreeViewIdState { | |||
id: { |
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.
Quick question: any reason why we are nesting treeId
? Is it to be able to identify the state related to a certain plugin more easily? Should we do the same for other plugin states?
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.
Is it to be able to identify the state related to a certain plugin more easily?
Yes, I took the habit to namespace everything in the state
Should we do the same for other plugin states?
Do we have some plugins where it is not the case?
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.
UseTreeViewFocusState
and UseTreeViewLabelState
do not follow this convention from what I see
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.
I think I fixed those in #14210 👼
But that's something I should definitely extract
Extracted from #14210
This is typically the type of instance methods that require us to re-render every item since it's used in the render of the item.
We need to make sure the id attribute of every item is up to date at all time, but with this PR we only have to listen to
treeId
in order to update the id attribute of the item.