You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Using a ListItemSecondaryAction within a Tooltip logs an error.
The children component of the Tooltip is not forwarding its props correctly.
Please make sure that props are spread on the same element that the ref is applied to.
Expected Behavior 🤔
Using MUI's own components within a Tooltip should not log an error.
Just render a component with hierarchy Tooltip > ListItem > ListItemSecondaryAction
Context 🔦
I discovered this while transitioning an app from v4 to v5.
Using the secondaryAction prop of ListItem rather than a using ListItemSecondaryAction as a child does not show the error (but has other effects, changes the dom structure).
I see the demo in v5 is using the secondaryAction prop, but ListItem API docs suggest using ListItemSecondaryAction as a child of ListItem is still supported. https://mui.com/api/list-item/
Thanks for the report. Looks like the warning would be shown with all components that do not spread the props on the first element, or at least the element that holds the ref (for example have some kind of container). Here is the simplest reproduction: https://codesandbox.io/s/nostalgic-fire-qxmv2?file=/src/App.js
Not sure what would be the best fix here, to be honest. If we just look in the children for the special prop anywhere in the hierarchy, it may give us false-positive if any tooltip is used inside its children.
Thank you for building MUI! ❤️
Current Behavior 😯
Using a
ListItemSecondaryAction
within aTooltip
logs an error.Expected Behavior 🤔
Using MUI's own components within a
Tooltip
should not log an error.Steps to Reproduce 🕹
https://codesandbox.io/s/delicate-paper-fb3c6?file=/src/App.js
Steps:
Tooltip
>ListItem
>ListItemSecondaryAction
Context 🔦
secondaryAction
prop ofListItem
rather than a usingListItemSecondaryAction
as a child does not show the error (but has other effects, changes the dom structure).secondaryAction
prop, butListItem
API docs suggest usingListItemSecondaryAction
as a child ofListItem
is still supported. https://mui.com/api/list-item/Your Environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: