if (window.React) {
  module.exports = window.React;
} else {
  module.exports = require('react');
}
if (typeof window !== 'undefined' && window.React) {
  module.exports = window.React;
} else {
  module.exports = require('react');
}
Test for existance of window
Test for existance of window
