星期三, 10月 18, 2017

[react.js] 雷雷小伙伴之坑

記錄一下菜B巴react.js之旅的error


Warning: Invalid DOM property `class`. Did you mean `className`?

就是JSX裡面用了html的保留字class啦,要用className

Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function but got: object


//死亡的原因是import加了{}
// import { App}  from './components/App';
import  App  from './components/App';

React-router 使用中 出现 Uncaught TypeError: Cannot read property ‘location’ of undefined

v3版跟v4版完全不一樣,裝了v4寫v3的code。
v4版的教學請參考如下
https://medium.com/@pshrmn/a-simple-react-router-v4-tutorial-7f23ff27adf


React.PropTypes.object 會undefiend

v15版之後好像要改import下面的
import PropTypes from 'prop-types'

react-dom.development.js:833 Uncaught TypeError: Cannot read property 'ReactCurrentOwner' of undefined



沒有留言:

張貼留言

留個話吧:)