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.
1 parent d20f540 commit 217631bCopy full SHA for 217631b
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