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] Apply experimental features in getDefaultizedParams instead of in the plugin render #14661

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Sep 18, 2024

Extracted from #14210 (first of a long list 😆 )

In #14210 I try to get rid of instance.isTreeViewEditable (because instance can only contain stuff that do not need to trigger a re-render of items when it changes). Instead I'm using the isItemEditable param directly (both in items and in plugins depending on useTreeViewLabel).

The easiest solution I found was to apply the default value of isItemEditable in getDefaultizedParams and to throw the error there when the experimental feature is not set.

@flaviendelangle flaviendelangle self-assigned this Sep 18, 2024
@flaviendelangle flaviendelangle added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Sep 18, 2024
@flaviendelangle flaviendelangle force-pushed the experimental-feature-getDefaultizedParams branch from f346b49 to 174c660 Compare September 18, 2024 15:43
@mui-bot
Copy link

mui-bot commented Sep 18, 2024

Copy link
Contributor

@noraleonte noraleonte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor! Thanks for tackling it! 🎉

@@ -54,10 +54,16 @@ export const extractPluginParamsFromProps = <
}
});

const cleanExperimentalFeatures =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nitpick: cleanExperimentalFeatures sounds a bit weird.. I get why it's called that, and I also don't have a better idea for what to call it, so I guess it's fine. 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from experimentalFeatures => cleanExperimentalFeatures to inExperimentalFeatures => experimentalFeatures

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!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants