/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/material-ui-express-ssr/createEmotionCache.js
17 строк
670 B
Sam Sycamore
[examples] Swap Next.js examples between App Router and Pages Router; update naming convention (#38204)
04 авг 2023, 22:28
Не верифицирован
04 авг 2023, 22:28
d18ed7d
Код
Авторство
О чём код?
import createCache from '@emotion/cache'; const isBrowser = typeof document !== 'undefined'; // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint. // This assures that Material UI styles are loaded first. // It allows developers to easily override Material UI styles with other styling solutions, like CSS modules. export default function createEmotionCache() { let insertionPoint; if (isBrowser) { const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]'); insertionPoint = emotionInsertionPoint ?? undefined; } return createCache({ key: 'mui-style', insertionPoint }); }