We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi shiningjason, 感謝你的教學, 很清楚明瞭, 我在學習過程中發現一點問題, 回報一下希望能幫助到你更版
“Level 7. 培養好習慣,設計防呆的 React 元件”章節有用到React.PropTypes.string 但React v15.5後已經不支援React.PropTypes, 進行到這段會報錯 (教學中提供的react cdn連結 https://cdnjs.com/libraries/react 目前已經是v16)
// 1. 使用 propTypes 定義參數的型別 TodoHeader.propTypes = { title: React.PropTypes.string, //Error: Cannot read property 'string' of undefined username: React.PropTypes.string, todoCount: React.PropTypes.number };
我上網爬了一下, 目前須改用prop-types https://reactjs.org/docs/typechecking-with-proptypes.html index.html: include prop-types
... <script src="https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.6.0/prop-types.min.js"></script> ...
TodoHeader.js: React.PropTypes改成PropTypes
// 1. 使用 propTypes 定義參數的型別 TodoHeader.propTypes = { title: PropTypes.string, username: PropTypes.string, todoCount: PropTypes.number };```
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi shiningjason,
感謝你的教學, 很清楚明瞭,
我在學習過程中發現一點問題, 回報一下希望能幫助到你更版
“Level 7. 培養好習慣,設計防呆的 React 元件”章節有用到React.PropTypes.string
但React v15.5後已經不支援React.PropTypes, 進行到這段會報錯
(教學中提供的react cdn連結 https://cdnjs.com/libraries/react 目前已經是v16)
我上網爬了一下, 目前須改用prop-types
https://reactjs.org/docs/typechecking-with-proptypes.html
index.html: include prop-types
TodoHeader.js: React.PropTypes改成PropTypes
The text was updated successfully, but these errors were encountered: