升级到反应:15.5.0导致错误

问题描述:

我做了一个npm安装来吸引最新版本的反应15.5.0,但是,我收到了一个非常神秘的错误,现在我的应用程序无法正常工作。我尝试搜索并找不到与我所看到的相关的任何内容。以下是我所看到的:升级到反应:15.5.0导致错误

warning.js:36 Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of GridContainer .

ReactReconciler.js:64 Uncaught (in promise) TypeError: Cannot read property 'getHostNode' of null at Object.getHostNode (ReactReconciler.js:64)

现在,我回到15.3.2,但想知道发生了什么。因为我想与所有的反应发展保持同步,并立即尝试和解决问题。我试着评论这些代码,看看它是否是导致问题的特定组件,但没有这样的运气。

任何帮助将不胜感激。

这里是GirdContainer

const GridContainer = ({ onOpen, open, onClose, numDrugSelected }) => (
<div style={{height: '100%'}}> 
     <Table> 
     <TableBody> 
      <TableRow> 
      <TableCell>Hello</TableCell> 
      </TableRow> 
     </TableBody> 
     </Table> 
</div> 
); 
+0

https://github.com/facebook/react/issues/8267 –

+0

我们可以获取GridContainer组件的代码吗? –

+0

当然,但它只是一个无国籍的组件。我删除了该组件后,认为它出了问题。 material-ui库中的一个组件发出了相同的警告。 – Gerb

好吧,我想通了什么事。最新版本的material-ui更改了一些默认导入。所以必须通过'material-ui/Table'中的导入表导入,然后才能使用Dialog从'material-iu'中导入{Table}。出于某种原因,webpack没有抱怨,所以我没有得到任何转译错误。只是运行时错误。奇怪,但我回来了,跑步。