index.js 699 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Copyright (c) 2013-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. */
  8. 'use strict';
  9. var React = require('react');
  10. var factory = require('./factory');
  11. if (typeof React === 'undefined') {
  12. throw Error(
  13. 'create-react-class could not find the React object. If you are using script tags, ' +
  14. 'make sure that React is being loaded before create-react-class.'
  15. );
  16. }
  17. // Hack to grab NoopUpdateQueue from isomorphic React
  18. var ReactNoopUpdateQueue = new React.Component().updater;
  19. module.exports = factory(
  20. React.Component,
  21. React.isValidElement,
  22. ReactNoopUpdateQueue
  23. );