2017-05-25 153 views
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

回答

0

好吧,我想通了什麼事。最新版本的material-ui更改了一些默認導入。所以必須通過'material-ui/Table'中的導入表導入,然後才能使用Dialog從'material-iu'中導入{Table}。出於某種原因,webpack沒有抱怨,所以我沒有得到任何轉譯錯誤。只是運行時錯誤。奇怪,但我回來了,跑步。

相關問題