Skip to content

Commit 75a7d45

Browse files
alexlafrosciaemmatown
authored andcommitted
Check for document instead of window (#550)
Closes #549
1 parent d27335d commit 75a7d45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/create-emotion/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ function createEmotion(
312312
caches.registered = {}
313313
}
314314

315-
if (typeof window !== 'undefined') {
315+
if (isBrowser) {
316316
let chunks = Array.from(document.querySelectorAll(`[data-emotion-${key}]`))
317317
chunks.forEach(node => {
318318
// $FlowFixMe

packages/create-emotion/src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const classnames = (args: Array<ClassNameArg>): string => {
7171
return cls
7272
}
7373

74-
export const isBrowser = typeof window !== 'undefined'
74+
export const isBrowser = typeof document !== 'undefined'
7575

7676
export type PrefixOption =
7777
| boolean

0 commit comments

Comments
 (0)