Skip to content

Commit f6123f2

Browse files
authored
fix: crash with React Native (#1724)
1 parent cc48d45 commit f6123f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/is-browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const isBrowser =
22
(typeof window !== 'undefined' && typeof window.document !== 'undefined') ||
33
// eslint-disable-next-line no-restricted-globals
4-
(typeof self !== 'undefined' && typeof self.postMessage === 'function') // is web worker
5-
4+
(typeof self !== 'undefined' && typeof self.postMessage === 'function') || // is web worker
5+
(typeof navigator !== 'undefined' && navigator.product === 'ReactNative') // while navigator.product is deprecated
66
export default isBrowser

0 commit comments

Comments
 (0)