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

babel-plugin-transform-react-stateless-component-name

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-react-stateless-component-name

A babel plugin to add name for default exported stateless components.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
165
decreased by-13.61%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-react-stateless-component-name

Build Status npm Codecov.io

Adds a display name to the stateless component in the React Dev Tools.

Note: Now will add displayName property to functions as well to help with Snapshot testing.

Example

// App.jsx
import React from 'react'

export default () => (
  <h1>Hello World!</h1>
)

// index.js
import App from './App'
import React from 'react'
import { render } from 'react-dom'

render(<App />, document.getElementById('root'))

Before

Before

After

After

Installation

Yarn

$ yarn add --dev babel-plugin-transform-react-stateless-component-name

npm

$ npm install --save-dev babel-plugin-transform-react-stateless-component-name

Usage

.babelrc

{
  "plugins": [
    "transform-react-stateless-component-name"
  ]
}

Via CLI

$ babel --plugins transform-react-stateless-component-name script.js

Via Node API

require('babel-core').transform('code', {
  plugins: [
    'transform-react-stateless-component-name',
  ],
})

Change Log

Full Change Log

v1.1.2 (2017-11-07)

  • [673e2a4128] - Update to use write-changelog package (Neil Kistner)
  • [a853f804b1] - Remove all istanbul ignores (#10) (Thomas Grainger)
  • [e875edd575] - Avoid crash on block-arrow components with hoc wrapper (#9) (Thomas Grainger)
  • [e98586fe5a] - Ignore JSX Expression blocks (#7) (Daniel J)

License

Copyright © 2015-2016 Neil Kistner

Released under the MIT license. See license for details.

Keywords

FAQs

Package last updated on 07 Nov 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