Skip to content

Commit 3dac785

Browse files
authored
Remove defaultProps syntax from functional components (#527)
* Remove defaultProps syntax from functional components * v4.5.3
1 parent c3d1e4b commit 3dac785

File tree

5 files changed

+248
-262
lines changed

5 files changed

+248
-262
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "4.5.2",
3+
"version": "4.5.3",
44
"description": "netdata UI kit",
55
"main": "dist/index.js",
66
"module": "dist/es6/index.js",

src/components/button/button.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ export const Button = forwardRef(
88
(
99
{
1010
label,
11-
icon,
11+
icon = null,
1212
flavour,
1313
isLoading,
1414
loadingLabel,
15-
onClick,
15+
onClick = () => {},
1616
textTransform = "firstLetter",
1717
iconColor,
1818
iconSize,
@@ -52,8 +52,3 @@ export const Button = forwardRef(
5252
</StyledButton>
5353
)
5454
)
55-
56-
Button.defaultProps = {
57-
onClick: () => {},
58-
icon: null,
59-
}

src/components/checkbox/checkbox.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const Checkbox = forwardRef(
1212
disabled,
1313
iconProps,
1414
indeterminate,
15-
Label,
15+
Label = Text,
1616
label,
1717
labelProps,
1818
labelPosition = "left",
@@ -73,8 +73,3 @@ export const Checkbox = forwardRef(
7373
)
7474
}
7575
)
76-
77-
Checkbox.defaultProps = {
78-
Label: Text,
79-
labelPosition: "right",
80-
}

0 commit comments

Comments
 (0)