Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-react-class-displayname

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-react-class-displayname

Babel plugin that adds class' name as static property `displayName`

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by20%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-react-class-displayname

Babel plugin that injects class' name as displayName property.

Install:

  npm i -D babel-plugin-transform-react-class-displayname

or

  yarn add babel-plugin-transform-react-class-displayname

Usage:

via .babelrc

{
   "plugins": ["transform-react-class-displayname"],
}

via cli

babel --plugins gtransform-react-class-displayname script.js

Note:

If You want to use this plugin with es2015 preset, you need to install transform class properties plugin

Example:

In:

  const component = class Class1 {
    static displayName = "Class1";
  };

  class Class2 {
    static displayName = "Class2";
  }

Out:

  const component = class Class1 {
    static displayName = "Class1";
  };

  class Class2 {
    static displayName = "Class2";
  }

Keywords

FAQs

Package last updated on 25 Jun 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc