💽Emotion Cache
How to integrate emotion cache with TSS
Last updated
Was this helpful?
Was this helpful?
import { TssCacheProvider } from "tss-react";
import createCache from "@emotion/cache";
const cache = createCache({
"key": "tss"
});
render(
<TssCacheProvider value={cache}>
{/* ... */}
</TssCacheProvider>
);import createCache from "@emotion/cache";
import { createTss } from "tss-react";
const cache = createCache({
key: "tss"
});
export const { tss } = createTss({
useTheme,
cache
});import createCache from "@emotion/cache";
// This is assuming you are using MUI, the useTheme function can be any hook that returns an object.
import { useTheme } from "@mui/material/styles";
import { createMakeAndWithStyles } from "tss-react";
const cache = createCache({
key: "tss"
});
export const { makeStyles, withStyles, useStyles } = createMakeAndWithStyles({
useTheme,
cache
});