-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Allow overriding internal components and their props #28692
Conversation
@material-ui/core: parsed: +0.11% , gzip: +0.17% |
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.
Looks great! 🙏
@@ -225,12 +225,15 @@ function composeEventHandler(handler, eventHandler) { | |||
}; | |||
} | |||
|
|||
// TODO (v6) Remove PopperComponent, PopperProps, TransitionComponent and TransitionProps. |
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.
👍
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 would recommend this todo convention,
// TODO (v6) Remove PopperComponent, PopperProps, TransitionComponent and TransitionProps. | |
// TODO v6: Remove PopperComponent, PopperProps, TransitionComponent and TransitionProps. |
It reduces the chance to forget something. There are already instances for v5 and v6 in the codebase.
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.
Nice addition :)
@@ -225,12 +225,15 @@ function composeEventHandler(handler, eventHandler) { | |||
}; | |||
} | |||
|
|||
// TODO (v6) Remove PopperComponent, PopperProps, TransitionComponent and TransitionProps. |
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 would recommend this todo convention,
// TODO (v6) Remove PopperComponent, PopperProps, TransitionComponent and TransitionProps. | |
// TODO v6: Remove PopperComponent, PopperProps, TransitionComponent and TransitionProps. |
It reduces the chance to forget something. There are already instances for v5 and v6 in the codebase.
@@ -1092,6 +1092,96 @@ describe('<Tooltip />', () => { | |||
}); | |||
}); | |||
|
|||
describe('prop: components', () => { |
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.
Do we need to test it? For instance, we didn't really test classes
before.
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.
components
prop is normally tested in describeConformanceUnstyled
test suite, but since we don't have an unstyled Tooltip yet, I added the test here directly. It can be removed when we have an unstyled Tooltip.
First discussed in #28679 (comment)
Adds
components
andcomponentProps
props to the Tooltip component.For slots that were customizable before (Transition, Popper), the new props (
components.Transition
,components.Popper
) take precedence over the old ones (TransitionComponent
,PopperComponent
).In the case of props,
componentsProps.popper
are merged withPopperProps
andcomponentsProps.transition
are merged withTransitionProps
. When there are conflicts,componentsProps
' values win.