-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
no example(s) setup showing what is required (cache/theme/? provider) #63
Comments
Hi @Morriz, If you follow the instructions it works without any known issues with MUI: https://docs.tss-react.dev/readme-1 If you want to use a custom cache there are specific instruction here but I recommend you to stick with the default setup. Best regard |
Hi, tnx for your quick reply. But is that cache needed in the first place? I don't read anything saying so. Thing is that I don't see any specificity ordering after following the instructions, sometimes loading theme styles before, and sometimes loading it after component styles |
do I have to forcefully use |
Btw, I already consistently use these exports: export const {
makeStyles,
useStyles, // <- To use when you need css or cx but don't have custom classes
} = createMakeStyles({ useTheme: getTheme }) (where |
Yes, it is, MUI is using emotion internally. We have to explicitly provide an emotion cache that uses
It's recommended to use
I am not sure that I understand what you mean. You don't have to use I can see you are frustrated, the upgrade from material-ui v4 to MUI v5 is not as smooth as you hoped it would be. Best regard, |
thanks for the in depth response. So the cache is needed, and I followed the instructions, but I still don't set the specificity enforced. Let me recap: I have this setup: <Suspense fallback={<Loader />}>
<CacheProvider value={muiCache}>
<ThemeProvider theme={getTheme()}>
...
<CssBaseline />
<Helmet titleTemplate='%s | xx' defaultTitle='xx' />
<Context.Provider
value={{
...
}}
>
<Router basename={env.CONTEXT_PATH || ''}>
<Switch>
<Route path='/' component={Dashboard} exact /> And I use export const {
makeStyles,
useStyles, // <- To use when you need css or cx but don't have custom classes
} = createMakeStyles({ useTheme: getTheme }) I am not using cx much, and assume it is mostly used to order the classnames that are given to it. So, what could I still be missing here? I see only one |
I see no error in the snippet of code you shared but I don't have the full picture.
Best regards |
That is awesome feedback. I will add you to the repo, as it is not really private just not ready for publication. |
I cloned your repo, I see master is still using Do you confirm that you are in the process of upgrading from |
Excuse me, I just pushed to branch moz/feat/app-shortcuts. It is there now. Sorry!
|
Also, I wouldn't mind sharing my screen if that helps ;)
|
I can't say for sure because there are some private dependencies that I can't install but looking at your And look in your chrome development tool if you can see the If you can't then we found the problem. If you know how to fix it great, if not I can share some tips. While I am at it. You are using the default mui Also you don't need the type annotation for Last thing, you don't need a callback if you're not using the (I have red squigly lines because I can't |
Thanks! I also found the culprit: I had to import the old mui 4 as peerdep for As to your last remark about not passing theme or typing it: I know so much, and eslint will warn me about it. However, I didn't receive type hints in your abstraction first, so that is why I type |
Only thing still not working correctly is global styles, but that is matter of minutiously following the component upgrade instructions I guess... Again, thanks so much! |
Great, I am glad your problem is (mostly) solved. |
Hi, thanks for all the hard work first of all. But would it be much to ask for some more extensive examples as to what is expected for this to work? I expect this lib has to order every bit off css to guarantee specificity, but following the docs it is not made clear what the minimal requirements are to do so.
The text was updated successfully, but these errors were encountered: