Closed qkdreyer closed 4 years ago
@qkdreyer We can't do much better than:
import React from "react";
import { ButtonGroup, Tooltip, Button } from "@material-ui/core";
function Wire({ children, ...other }) {
return children(other);
}
/**
* how you used the components
*/
export default function Demo() {
return (
<ButtonGroup>
<Wire>
{props => (
<Tooltip title="You don't have permission to do this">
<span>
<Button {...props} disabled>
A Disabled Button
</Button>
</span>
</Tooltip>
)}
</Wire>
<Button>A Button</Button>
</ButtonGroup>
);
}
https://codesandbox.io/s/busy-poitras-rh26y?file=/src/Demo.js:0-606
Closing as we are technically limited. If not enough, you would need to rewrite the component, changing the design tradeoff.
That's a great fix for the unwired props, but we're still missing some style from the ButtonGroup children (look at the missing border-radius) :
Is there any workaround about that ?
It's what I meant by "limited".
Current Behavior 😯
Expected Behavior 🤔
Steps to Reproduce 🕹
https://codesandbox.io/s/old-night-n2z35
Steps:
Context 🔦
Just using multiple Mui components
Your Environment 🌎