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 😯
Because ButtonGroup passes the values assuming the direct children are Buttons, it's passing these props to the Badge Element, causing the breakage. The styles and props aren't applied to the descendant Button, and the following errors occur:
Warning: Failed prop type: Invalid prop `variant` of value `outlined` supplied to
`ForwardRef(Badge)`, expected one of ["dot","standard"].`
`Warning: React does not recognize the fullWidth / disableRipple / disableFocusRipple
prop on a DOM element.`
This is the same as this person was experiencing: #16156, but while that use case has a reasonable workaround, I don't know that this one does as much (and it seems like a very common use case)
Expected Behavior 🤔
It would be great if there was either:
A way to have non-Button children of ButtonGroup (I'd imagine this would be ideal, because it makes sense to wrap ToolTips and other things around buttons in groups?
Have a way to have a Badge that doesn't involve wrapping it.
The workaround of forwarding the props when nesting buttons doesn't fully work because the .MuiButtonGroup-grouped:not(:first-child) and .MuiButtonGroup-grouped:not(:last-child) selectors aren't matched.
Edit: in case this helps someone, I've ended up opting for a workaround like this:
Current Behavior 😯
Because
ButtonGroup
passes the values assuming the direct children areButton
s, it's passing these props to theBadge
Element, causing the breakage. The styles and props aren't applied to the descendantButton
, and the following errors occur:This is the same as this person was experiencing: #16156, but while that use case has a reasonable workaround, I don't know that this one does as much (and it seems like a very common use case)
Expected Behavior 🤔
It would be great if there was either:
ButtonGroup
(I'd imagine this would be ideal, because it makes sense to wrapToolTip
s and other things around buttons in groups?Steps to Reproduce 🕹
https://codesandbox.io/embed/create-react-app-b6odz
The text was updated successfully, but these errors were encountered: