/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/material-ui-react-router-ts/app/createCache.ts
15 строк
530 B
Siriwat K
[examples] Add `material-ui-react-router-ts` example (#46406)
24 июн 2025, 12:39
Не верифицирован
24 июн 2025, 12:39
770923f
Код
Авторство
О чём код?
import createCache from '@emotion/cache'; export default function createEmotionCache(options?: Parameters<typeof createCache>[0]) { const emotionCache = createCache({ key: 'mui', ...options }); const prevInsert = emotionCache.insert; emotionCache.insert = (...args) => { // ignore styles that contain layer order (`@layer ...` without `{`) if (!args[1].styles.match(/^@layer\s+[^{]*$/)) { args[1].styles = `@layer mui {${args[1].styles}}`; } return prevInsert(...args); }; return emotionCache; }