babel-plugin-display-name
v0.1.0
Published
add displayName
Readme
babel-plugin-display-name
add displayName
Install
$ yarn add --dev babel-plugin-display-nameUsage
.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):
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT © akameco
