启用了forbid-prop-types规则后,eslint
禁止使用style: React.PropTypes.object
,shape
建议使用.
但是真的有必要为此目的定义所有可用的属性吗?
DEMO.propTypes = {
style: React.PropTypes.shape({
color: React.PropTypes.string,
fontSize: React.PropTypes.number,
...
})
};
Run Code Online (Sandbox Code Playgroud)
定义代码太多了!