JSPM

babel-plugin-add-react-displayname

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1212979
  • Score
    100M100P100Q206320F
  • License MIT

Automatically add displayName to all your components

Package Exports

  • babel-plugin-add-react-displayname

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-add-react-displayname) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babel-plugin-add-react-displayname

Automatically detects and sets displayName for React components. This is useful for having real component names show up in production builds of React apps.

Babel already does this for React.createClass style components, this adds support for the two other kinds of component definitions:

  • ES6-classes style components
  • Stateless components that return JSX

Installation

Simply add babel-plugin-add-react-displayname to your .babelrc file:

{
    "plugins": ["babel-plugin-add-react-displayname"]
}

Testing

npm test