react-native-iconfont-cli
react-native-iconfont-cli copied to clipboard
defaultProps属性后续会弃用,模板是否可以更改下?
如下图提示
IconZhuye.defaultProps = { size: 18, };
这样的写法,是否可以改成这样呢
FunctionComponent<Props> = ({size = 18, color, ...rest})
I also meet this error message
可以在node_modules/react-native-iconfont-cli/templates 文件夹中修改模板
注释或删除代码块
//#componentName#.defaultProps = { // size: #size#, //};
#size#属性添加至
let #componentName#: FunctionComponent<Props> = ({ size=#size#, color, ...rest }) => { ...