react-native-iconfont-cli icon indicating copy to clipboard operation
react-native-iconfont-cli copied to clipboard

defaultProps属性后续会弃用,模板是否可以更改下?

Open LuoYuChenZhou opened this issue 1 year ago • 3 comments

如下图提示 image image

IconZhuye.defaultProps = { size: 18, };

这样的写法,是否可以改成这样呢

FunctionComponent<Props> = ({size = 18, color, ...rest})

LuoYuChenZhou avatar Jul 08 '24 12:07 LuoYuChenZhou

I also meet this error message

JamesZhao2022 avatar Jul 25 '24 03:07 JamesZhao2022

可以在node_modules/react-native-iconfont-cli/templates 文件夹中修改模板

shugangbin avatar Aug 07 '24 01:08 shugangbin

注释或删除代码块 //#componentName#.defaultProps = { // size: #size#, //}; #size#属性添加至 let #componentName#: FunctionComponent<Props> = ({ size=#size#, color, ...rest }) => { ...

shugangbin avatar Aug 07 '24 01:08 shugangbin