From f871c763d3f34b8e6f810c4c6e7ac7df69ddaaff Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 25 May 2020 06:44:58 +0200 Subject: [PATCH] Document why --- packages/material-ui/src/utils/createSvgIcon.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/material-ui/src/utils/createSvgIcon.js b/packages/material-ui/src/utils/createSvgIcon.js index 13873d5f15b108..ef964739eb4cc2 100644 --- a/packages/material-ui/src/utils/createSvgIcon.js +++ b/packages/material-ui/src/utils/createSvgIcon.js @@ -12,6 +12,8 @@ export default function createSvgIcon(path, displayName) { ); if (process.env.NODE_ENV !== 'production') { + // Need to set `displayName` on the inner component for React.memo. + // React prior to 16.14 ignores `displayName` on the wrapper. Component.displayName = `${displayName}Icon`; }