Google chrome extension 反应,可以';不要通过任何方法';MountComponentNode';

Google chrome extension 反应,可以';不要通过任何方法';MountComponentNode';,google-chrome-extension,reactjs,Google Chrome Extension,Reactjs,我有一个如下所示的html: <head> <script src="../js/vendor/jquery-2.1.0.js"></script> <script src="../js/vendor/react.js"></script> <script src="../js/jsx/todo.js"></script> </head> <body> <div id

我有一个如下所示的html:

<head>
  <script src="../js/vendor/jquery-2.1.0.js"></script>
  <script src="../js/vendor/react.js"></script>
  <script src="../js/jsx/todo.js"></script>
</head>
<body>
  <div id="ola"></div>
  <script src="../js/popup.js"></script>
</body>
但是页面上什么也没有显示!控制台显示一个错误:

Uncaught TypeError: Object function (props, children) {
      var instance = new Constructor();
      instance.construct.apply(instance, arguments);
      return instance;
    } has no method 'mountComponentIntoNode' react.js:10052

我真的不知道为什么会这样,我只是尝试从网站上的示例中重新创建。如果重要的话,它是在一个chrome扩展中。

Ahhh在渲染时弄错了一行

popup.js应该是:

React.renderComponent(TodoApp(), document.getElementById('ola'));

抢手货我将看看我们是否可以在React中针对这个特定的案例发出一个很好的警告。我在使用npm(使用ES6和babel)的
React test utils
时一直遇到这个错误。我的组件是有效的。我从npm切换到
react addons test utils
,一切都奇迹般地正常工作。
React.renderComponent(TodoApp(), document.getElementById('ola'));