# babel-plugin-add-react-displayname

> Automatically add displayName to all your components

Latest version **0.0.5** (published 2018-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-add-react-displayname
pnpm add babel-plugin-add-react-displayname
yarn add babel-plugin-add-react-displayname
bun add babel-plugin-add-react-displayname
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2018-01-30 |
| First published | 2016-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 84 |
| Author | Ron Cohen |
| Maintainers | roncohen |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-add-react-displayname
- Repository: https://github.com/opbeat/babel-plugin-add-react-displayname
- Homepage: https://github.com/opbeat/babel-plugin-add-react-displayname#readme
- Issues: https://github.com/opbeat/babel-plugin-add-react-displayname/issues
- npm.io page: https://npm.io/package/babel-plugin-add-react-displayname

## Recent versions

- 0.0.5 (latest) — 2018-01-30
- 0.0.4 — 2016-12-10
- 0.0.3 — 2016-10-04
- 0.0.2 — 2016-09-28
- 0.0.1 — 2016-09-28

## 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 `add-react-displayname` to your `.babelrc` file:

```json
{
    "plugins": ["add-react-displayname"]
}
```

## Troubleshooting

#### Doesn't work for decorated classes

If you are using the `transform-decorators-legacy` plugin, make sure it's placed *after* this plugin in your plugin list. 

## Testing

`npm test`

---
_Source: https://npm.io/package/babel-plugin-add-react-displayname · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
