0.1.0 • Published 6 years ago
babel-plugin-display-name v0.1.0
babel-plugin-display-name
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
0.1.0
6 years ago