From d39abeda93da6bee011ffce7e902a466f67616a7 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Thu, 26 May 2016 07:38:16 -0700 Subject: [PATCH] fix(browser): remove variable thats undefined in react-native https://github.com/facebook/react-native/pull/1632 --- browser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/browser.js b/browser.js index 7c76452..a31d6ff 100644 --- a/browser.js +++ b/browser.js @@ -39,7 +39,8 @@ exports.colors = [ function useColors() { // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) || // is firebug? http://stackoverflow.com/a/398120/376773 (window.console && (console.firebug || (console.exception && console.table))) || // is firefox >= v31?