React.createClass会报warning

create-react-app中使用React-createClas会报如下warning,只能使用extends React.Component.
使用ant design时会报propTypes的warning,报错如下图
求助大神

https://img3.mukewang.com/5b5293b5000157bf08000068.jpg

守着星空守着你
浏览 834回答 2
2回答

慕婉清6462132

React.CreatClass将要被废除了,所以不鼓励使用,其实对于简单的展示组件,推荐直接写成函数形式,需要用到生命周期的,用extends React.Component这种形式

ibeautiful

react新版将废弃createClass,propType将会分到一个新的模块
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

React.JS