Skip to content

Commit

Permalink
fix: crash with React Native (#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
horstleung committed Oct 30, 2023
1 parent cc48d45 commit f6123f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/is-browser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const isBrowser =
(typeof window !== 'undefined' && typeof window.document !== 'undefined') ||
// eslint-disable-next-line no-restricted-globals
(typeof self !== 'undefined' && typeof self.postMessage === 'function') // is web worker

(typeof self !== 'undefined' && typeof self.postMessage === 'function') || // is web worker
(typeof navigator !== 'undefined' && navigator.product === 'ReactNative') // while navigator.product is deprecated
export default isBrowser

0 comments on commit f6123f2

Please sign in to comment.