Warning: Invalid DOM property `class`. Did you mean `className`?
就是JSX裡面用了html的保留字class啦,要用className
v15版之後好像要改import下面的
import PropTypes from 'prop-types'
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'
沒有留言:
張貼留言
留個話吧:)