Skip to content

Commit c5d3ce9

Browse files
committed
Use default args to set default props instead of function.defaultProps
1 parent fec4547 commit c5d3ce9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

bin/build.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ fs.readdirSync(iconsDir).forEach(file => {
4646
import React, { forwardRef } from 'react';
4747
import PropTypes from 'prop-types';
4848
49-
const ${ComponentName} = forwardRef(({ color, size, title, className, ...rest }, ref) => {
49+
const ${ComponentName} = forwardRef(({
50+
color = 'currentColor',
51+
size = '1em',
52+
title = null,
53+
className = '',
54+
...rest
55+
}, ref) => {
5056
return (
5157
<svg
5258
ref={ref}
@@ -71,13 +77,6 @@ fs.readdirSync(iconsDir).forEach(file => {
7177
className: PropTypes.string,
7278
};
7379
74-
${ComponentName}.defaultProps = {
75-
color: 'currentColor',
76-
size: '1em',
77-
title: null,
78-
className: '',
79-
};
80-
8180
export default ${ComponentName};
8281
`;
8382

0 commit comments

Comments
 (0)