React路上遇到的Bug


在學習React的道路上,經常遇到很多的bug,而且發現它的bug很不好找到錯誤在哪里,尤其像下面的這些:

但是我們可以利用這樣一種方法:從控制台中找到提供的鏈接

1. Error: Minified React error #109;

 Error: Minified React error #109;

visit http://facebook.github.io/react/docs/error-decoder.html?invariant=109&args[]=Form for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

從該鏈接中可以找到:錯誤原因:沒有return返回數據

Form.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.

2. Uncaught TypeError: Super expression must either be null or a function, not undefined

錯誤原因:就在super之前查找代碼的錯誤,一般是拼寫錯誤;大都是React.Component的C沒有大寫;

 3.TypeError: Cannot read property 'func' of undefined

在使用react-router的時候,要注意下載的版本問題;

import {Router,hashHistory,browserHistory,Route,IndexRoute,IndexRedirect,Redirect} from 'react-router'

上面下載的版本要使用:

"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-mixin": "^4.0.0",
"react-router": "^2.8.1",


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM