猿问

React.createClass会报warning

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

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

慕婉清6462132

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

ibeautiful

react新版将废弃createClass,propType将会分到一个新的模块
随时随地看视频慕课网APP

相关分类

React.JS
我要回答