我做了一個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>
);
https://github.com/facebook/react/issues/8267 –
我們可以獲取GridContainer組件的代碼嗎? –
當然,但它只是一個無國籍的組件。我刪除了該組件後,認爲它出了問題。 material-ui庫中的一個組件發出了相同的警告。 – Gerb