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

babel-plugin-react-display-name

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-display-name

Add displayName to React.createClass calls

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
206K
increased by98.51%
Maintainers
1
Weekly downloads
 
Created

What is babel-plugin-react-display-name?

The babel-plugin-react-display-name package is a Babel plugin that automatically adds displayName properties to React components. This is particularly useful for debugging purposes, as it allows React components to be more easily identified in the React Developer Tools.

What are babel-plugin-react-display-name's main functionalities?

Automatic displayName addition

This feature automatically adds a displayName property to React components, making them easier to identify in debugging tools. The code sample shows a simple React component before and after the Babel transformation.

/* Babel configuration file (e.g., .babelrc) */
{
  "plugins": [
    "babel-plugin-react-display-name"
  ]
}

/* React component file */
import React from 'react';

const MyComponent = () => {
  return <div>Hello, World!</div>;
};

export default MyComponent;

/* After Babel transformation */
import React from 'react';

const MyComponent = () => {
  return <div>Hello, World!</div>;
};

MyComponent.displayName = 'MyComponent';

export default MyComponent;

Other packages similar to babel-plugin-react-display-name

Keywords

FAQs

Package last updated on 20 Jun 2015

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