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] Improve docs and warning for custom children #22775

Merged
merged 8 commits into from Oct 5, 2020

Conversation

brorlarsnicklas
Copy link
Contributor

Closes #21324

@mui-pr-bot
Copy link

mui-pr-bot commented Sep 27, 2020

Details of bundle changes

Generated by 🚫 dangerJS against dae33cc

packages/material-ui/src/Tooltip/Tooltip.js Outdated Show resolved Hide resolved
packages/material-ui/src/Tooltip/Tooltip.js Outdated Show resolved Hide resolved
@mbrookes mbrookes changed the title [Tooltip] Using custom component as children not working [Tooltip] Improve docs and warning for custom children Sep 27, 2020
@oliviertassinari oliviertassinari added component: tooltip This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation labels Sep 27, 2020
@brorlarsnicklas
Copy link
Contributor Author

@oliviertassinari @mbrookes I pushed a new commit because of the circle-ci:test_unit-1 failed. I think that it is solved in the correct way. I interpreted that the childrenProps['data-mui'] was introduced so that only the useEffect would be triggered if not in production. Was this the right way to go? Thanks in advance :)

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Could you add a new test? (I believe the last commit break the logic, so it sounds like we need a test to help assert it behave correctly :))

@brorlarsnicklas
Copy link
Contributor Author

brorlarsnicklas commented Sep 28, 2020

@oliviertassinari Okey, I could give it a try! So you mean that we should stick to the first commit, but add a new test in the Tooltip.test.js that covers the console.error? Or did you mean that we should stick to the last commit and add a test to that?

@brorlarsnicklas
Copy link
Contributor Author

@oliviertassinari sorry but I'm not really sure where this new test case should be placed, is it in the Tooltip.test.js?

@eps1lon
Copy link
Member

eps1lon commented Oct 1, 2020

@oliviertassinari sorry but I'm not really sure where this new test case should be placed, is it in the Tooltip.test.js?

Yes. You can take a look at the other tests using toErrorDev or toWarnDev on how you could write a test for this PR.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 4, 2020
eps1lon
eps1lon previously requested changes Oct 4, 2020
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

This is fine. But we should be careful with the name.

packages/material-ui/src/Tooltip/Tooltip.js Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 4, 2020
@eps1lon eps1lon merged commit fc37528 into mui:next Oct 5, 2020
@eps1lon
Copy link
Member

eps1lon commented Oct 5, 2020

@brorlarsnicklas Nice work, thanks!

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! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tooltip] Using custom component as children not working
5 participants