We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 07808d9 + 217631b commit 4a656b7Copy full SHA for 4a656b7
lib/utils/getPrefix.es6
@@ -1,5 +1,9 @@
1
export default (function() {
2
- if (typeof window === 'undefined') return '';
+ // Checking specifically for 'window.document' is for pseudo-browser server-side
3
+ // environments that define 'window' as the global context.
4
+ // E.g. React-rails (see https://github.com/reactjs/react-rails/pull/84)
5
+ if (typeof window === 'undefined' || typeof window.document === 'undefined') return '';
6
+
7
// Thanks David Walsh
8
let styles = window.getComputedStyle(document.documentElement, ''),
9
pre = (Array.prototype.slice
0 commit comments