Possible to get access to cx when using withStyles? #80
-
Hi, just started using One question I do have: when using the Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @rlansky-percipient, import { withStyles, useStyles } from "tss-react/mui";
type Props = {
className?: string;
};
const MyComponent = (props: Props) => {
const { className } = props;
const { cx, css } = useStyles();
return (
<div className={cx(css({ "height": 300 }), className)}>
{/*...*/}
</div>
);
};
const MyComponentStyled= withStyles(
MyComponent,
{
"root": {
"width": 200
}
}
); I don't know if it's what you need...? |
Beta Was this translation helpful? Give feedback.
Hi @rlansky-percipient,
Thanks for the kind words.
I am not sure that I understand exactly how you would use
cx
withwithStyles
but do you know that you can import directlyuseStyles
fromtss-react/mui
without having to first generate it usingmakeStyles
.It returns
cx
andcss
.I …