Skip to content

Commit 209cfd0

Browse files
committed
feat: Use React.memo to enhance rendering
1 parent f676b9a commit 209cfd0

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

snapshots/demo-js/IconAlipay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ IconAlipay.defaultProps = {
2323
size: 18,
2424
};
2525

26-
export default IconAlipay;
26+
export default React.memo ? React.memo(IconAlipay) : IconAlipay;

snapshots/demo-js/IconSetup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ IconSetup.defaultProps = {
5959
size: 18,
6060
};
6161

62-
export default IconSetup;
62+
export default React.memo ? React.memo(IconSetup) : IconSetup;

snapshots/demo-js/IconUser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ IconUser.defaultProps = {
2323
size: 18,
2424
};
2525

26-
export default IconUser;
26+
export default React.memo ? React.memo(IconUser) : IconUser;

snapshots/demo-js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ const IconFont = ({ name, ...rest }) => {
1919
return null;
2020
};
2121

22-
export default IconFont;
22+
export default React.memo ? React.memo(IconFont) : IconFont;

snapshots/demo-ts/IconAlipay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ IconAlipay.defaultProps = {
3030
size: 20,
3131
};
3232

33-
export default IconAlipay;
33+
export default React.memo ? React.memo(IconAlipay) : IconAlipay;

snapshots/demo-ts/IconSetup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ IconSetup.defaultProps = {
6666
size: 20,
6767
};
6868

69-
export default IconSetup;
69+
export default React.memo ? React.memo(IconSetup) : IconSetup;

snapshots/demo-ts/IconUser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ IconUser.defaultProps = {
3030
size: 20,
3131
};
3232

33-
export default IconUser;
33+
export default React.memo ? React.memo(IconUser) : IconUser;

snapshots/demo-ts/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ const IconFont: FunctionComponent<Props> = ({ name, ...rest }) => {
2929
return null;
3030
};
3131

32-
export default IconFont;
32+
export default React.memo ? React.memo(IconFont) : IconFont;

src/templates/Icon.js.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ const IconFont = ({ name, ...rest }) => {
1111
return null;
1212
};
1313

14-
export default IconFont;
14+
export default React.memo ? React.memo(IconFont) : IconFont;

src/templates/Icon.tsx.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ const IconFont: FunctionComponent<Props> = ({ name, ...rest }) => {
2121
return null;
2222
};
2323

24-
export default IconFont;
24+
export default React.memo ? React.memo(IconFont) : IconFont;

0 commit comments

Comments
 (0)