-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
withStyles #16
Comments
Hi @Jack-Works,
I will work on theses points, feel free to give feedback on the branch I just created. |
I'm only focused on extending the existing components with function createMakeStyles<Theme>(useTheme) {
function withStyles<T>(Component: React.ComponentType<T>) {
type Classes = T extends { classes?: Partial<Record<infer U, string>> } ? U : never
return function appendStyles(style: StyleOf<Classes, T>) {}
}
} |
This is where I am at so far. I will do an overload of |
I guess it can be a single function. It just looks like a |
Line 30 in 0e0dd95
You should use |
Ok, now that I have addressed the problem related to the mui By the way, the only way I found to make When the cache is explicitly provided to |
The contextual cache is important in our use case. Is there some features that cannot work with contextual cache? (We're not using SSR) |
Mui v5 |
Hi, it's OK to have a different cache for MUI and tss-react for us, but the cache must come from the React Context. e.g. We can write this: <MuiEmotionCacheProvider cache={cache1}>
<TSSReactEmotionCacaheProvider cache={cache2}>
{children} |
This is a can do, IDK why I didn't think of it myself. Let me implement that. |
@Jack-Works I implemented the cache provider you suggested. |
Yes, it works in our product. Thanks for your work! |
I have upgraded to the latest version in DimensionDev/Maskbook#4163 |
Hi, any update regarding withStyles ?:) |
not yet, but I hope I'll find the time to finalize it by Monday. |
@LabuzzMichal, sorry. I have worked extensively on this this week end but it still needs some more work before being released. |
@garronej thank you for update! |
Just a quick update to notify that I am working on this |
I pull it off eventually 🎉 const MyDivStyled= withStyle("div", { "root": { "color": "red" } }); Anyway it's available on the latest patch update. I will do a minor bump when everything is tested and documented. |
Great, thank you :) |
Hi @garronej, The only difference I noticed comparing to MUI withStyles is lack of possibility to write combined styles like below
However it works fine if I just add these values
|
@LabuzzMichal thank you for the feedback. |
Could you implement
withStyles
intss-react
too? It's convenient when just want to overwrite the style of a Mui Component.Originally posted by @Jack-Works in mui/material-ui#26571 (comment)
The text was updated successfully, but these errors were encountered: