We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21bc9f8 commit 318d15fCopy full SHA for 318d15f
libraries/load-themed-styles/src/index.ts
@@ -164,6 +164,9 @@ function initializeThemeState(): IThemeState {
164
* @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode.
165
*/
166
export function loadStyles(styles: string | ThemableArray, loadAsync: boolean = false): void {
167
+ if (typeof document === 'undefined') {
168
+ return;
169
+ }
170
measure(() => {
171
const styleParts: ThemableArray = Array.isArray(styles) ? styles : splitStyles(styles);
172
if (_injectStylesWithCssText === undefined) {
0 commit comments