Socket
Book a DemoInstallSign in
Socket

@mui/internal-babel-plugin-display-name

Package Overview
Dependencies
Maintainers
9
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui/internal-babel-plugin-display-name

Babel plugin for automatic React display name generation with tree-shaking and prefix support, forked from @zendesk/babel-plugin-react-displayname.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
12K
-13.82%
Maintainers
9
Weekly downloads
 
Created
Source

@babel-plugin-display-name

Forked from: https://github.com/zendesk/babel-plugin-react-displayname

What does it do?

This plugin converts the following:

const Linebreak = React.memo(() => {
  return <br />;
});

const Img = function () {
  return <img />;
};

into:

const Linebreak = React.memo(function _Linebreak() {
  return <br />;
});
Linebreak.displayName = 'Linebreak';

const Img = function () {
  return <img />;
};
Img.displayName = 'Img';

Options

allowedCallees

Object.<string, string[]>, defaults to { "react": ["createContext"] }

Enables generation of displayNames for certain called functions.

{
  "plugins": [
    "@probablyup/babel-plugin-react-displayname",
    {
      "allowedCallees": {
        "react": ["createComponent"]
      }
    }
  ]
}

Keywords

displayName

FAQs

Package last updated on 20 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts