Skip to content
New issue

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

lesson24出现warning #10

Open
wuding129 opened this issue Apr 24, 2017 · 1 comment
Open

lesson24出现warning #10

wuding129 opened this issue Apr 24, 2017 · 1 comment

Comments

@wuding129
Copy link

wuding129 commented Apr 24, 2017

感谢作者的教程,学起来很愉快。只是教程里评论总提示请文明用语。。。
学习lesson24这节的时候发现会有propTypes 的warning,查询后发现15.5后已经独立出来了
// After (15.5)
`import React from 'react';
import PropTypes from 'prop-types';

class Component extends React.Component {
render() {
return

{this.props.text}
;
}
}

Component.propTypes = {
text: PropTypes.string.isRequired,
};`
参考:https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes

@huzidaha
Copy link
Owner

是的,本书刚写完就发布了新版本,章节内容需要更新。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants