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

[Tooltip][material] Improve warning when Tooltip receives string child #37530

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

DiegoAndai
Copy link
Member

@DiegoAndai DiegoAndai commented Jun 6, 2023

Closes #18119

When Tooltip receives a string as a child, wrap it in a span element to avoid a server error. The element will render and a warning will be thrown so the developer knows what to do.

New warning

Screenshot 2023-06-06 at 16 38 49

@DiegoAndai DiegoAndai added component: tooltip This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material enhancement This is not a bug, nor a new feature labels Jun 6, 2023
@mui-bot
Copy link

mui-bot commented Jun 6, 2023

Netlify deploy preview

https://deploy-preview-37530--material-ui.netlify.app/

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against 7659b3f

Co-authored-by: Siriwat K <siriwatkunaporn@gmail.com>
Signed-off-by: Diego Andai <diego@mui.com>
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍

@DiegoAndai DiegoAndai merged commit b019b36 into mui:master Jun 15, 2023
18 checks passed
@DiegoAndai DiegoAndai deleted the tooltip-string-child-warning branch June 15, 2023 13:48
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 21, 2023

Nice DX improvement 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tooltip This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature package: material-ui Specific to @mui/material
Projects
Status: Recently completed
Development

Successfully merging this pull request may close these issues.

[Tooltip] TypeError: Cannot read property 'className' of undefined
4 participants