We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89d51ca commit b452aebCopy full SHA for b452aeb
packages/react/src/utils/index.js
@@ -5,6 +5,8 @@ import { css } from 'styled-components'
5
const REGEX_HTTPS = /^https/
6
const REGEX_LOCALHOST = /http:\/\/localhost/
7
8
+const isSSR = typeof window === 'undefined'
9
+
10
export const isFunction = fn => typeof fn === 'function'
11
12
export const isObject = obj => typeof obj === 'object'
@@ -81,4 +83,4 @@ export const imageProxy = url => {
81
83
)}`
82
84
}
85
-export const isLazySupported = !isNil(window) && !isNil(window.IntersectionObserver)
86
+export const isLazySupported = !isSSR && 'IntersectionObserver' in window
0 commit comments