Skip to content

Commit d39abed

Browse files
committed
fix(browser): remove variable thats undefined in react-native
facebook/react-native#1632
1 parent 39ecd87 commit d39abed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

browser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ exports.colors = [
3939

4040
function useColors() {
4141
// is webkit? http://stackoverflow.com/a/16459606/376773
42-
return ('WebkitAppearance' in document.documentElement.style) ||
42+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
43+
return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) ||
4344
// is firebug? http://stackoverflow.com/a/398120/376773
4445
(window.console && (console.firebug || (console.exception && console.table))) ||
4546
// is firefox >= v31?

0 commit comments

Comments
 (0)