React路上遇到的Bug
生活随笔
收集整理的這篇文章主要介紹了
React路上遇到的Bug
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在學(xué)習(xí)React的道路上,經(jīng)常遇到很多的bug,而且發(fā)現(xiàn)它的bug很不好找到錯(cuò)誤在哪里,尤其像下面的這些:
但是我們可以利用這樣一種方法:從控制臺(tái)中找到提供的鏈接
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.
從該鏈接中可以找到:錯(cuò)誤原因:沒有return返回?cái)?shù)據(jù)
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
錯(cuò)誤原因:就在super之前查找代碼的錯(cuò)誤,一般是拼寫錯(cuò)誤;大都是React.Component的C沒有大寫;
?3.TypeError: Cannot read property 'func' of undefined
在使用react-router的時(shí)候,要注意下載的版本問題;
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",轉(zhuǎn)載于:https://www.cnblogs.com/naniandongzhi/p/8278771.html
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的React路上遇到的Bug的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 有专门介绍RobotStudi的教材吗?
- 下一篇: C#之线程