0.1.0 • Published 6 years ago

babel-plugin-display-name v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

babel-plugin-display-name

Build Status tested with jest styled with prettier All Contributors

add displayName

Install

$ yarn add --dev babel-plugin-display-name

Usage

.babelrc

{
  "plugins": ["display-name"]
}

Examples

Before

class Display extends React.Component {
  // @displayName
  static On = () => <div>On</div>
  static Off = () => <div>Off</div>

  render() {
    return <div>{this.props.children}</div>
  }
}

After

class Display extends React.Component {
  // @displayName
  static On = () => <div>On</div>
  static Off = () => <div>Off</div>

  render() {
    return <div>{this.props.children}</div>
  }
}

Display.On.displayName = "Display.On"

Contributors

Thanks goes to these wonderful people (emoji key):

akameco💻 📖 ⚠️ 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco