Emotion Cache
How to integrate emotion cache with TSS
Last updated
Was this helpful?
How to integrate emotion cache with TSS
Last updated
Was this helpful?
There is three ways to make tss-react use a specific emotion cache instead of the default one.
tss-react pickups the contextual cache.
If you want to provide a contextuel cache only to tss-react
you can use the <TssCacheProvider />
.
This is usefull if you want to .
To be clear, the difference between import { CacheProvider } from "@emotion/react";
and import { TssCacheProvider } from "tss-react";
is that the cahe provided by <TssCacheProvider />
will only be picked up by tss-react
when the cache provided by <CacheProvider />
will be picked up by TSS, MUI and any direct usage of @emotion/react
.
This approach isn't the best option for SSR.
If you are . You should avoid using <TssCacheProvider />
if you want to avoid having tss-react
as peerDependency of your module.