diff --git a/lib/utils.js b/lib/utils.js index aef5fa1..180820f 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -175,13 +175,15 @@ function trim(str) { * typeof document -> undefined * * react-native: - * typeof document.createElement -> undefined + * navigator.product -> 'ReactNative' */ function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + return false; + } return ( typeof window !== 'undefined' && - typeof document !== 'undefined' && - typeof document.createElement === 'function' + typeof document !== 'undefined' ); }