Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LuoYuChenZhou opened this issue Jul 8, 2024 · 3 comments
Open

Comments

@LuoYuChenZhou
Copy link

如下图提示
image
image

IconZhuye.defaultProps = {
size: 18,
};

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

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

@JamesZhao2022
Copy link

I also meet this error message

@shugangbin
Copy link

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

@shugangbin
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants