diff --git a/packages/material-ui/src/utils/createSvgIcon.js b/packages/material-ui/src/utils/createSvgIcon.js index b6bd06e520c03f..ef964739eb4cc2 100644 --- a/packages/material-ui/src/utils/createSvgIcon.js +++ b/packages/material-ui/src/utils/createSvgIcon.js @@ -5,19 +5,19 @@ import SvgIcon from '../SvgIcon'; * Private module reserved for @material-ui/x packages. */ export default function createSvgIcon(path, displayName) { - const Component = React.memo( - React.forwardRef((props, ref) => ( - - {path} - - )), + const Component = (props, ref) => ( + + {path} + ); 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`; } Component.muiName = SvgIcon.muiName; - return Component; + return React.memo(React.forwardRef(Component)); }