A Babel plugin (v1.1.2) that automatically adds a `displayName` property to default-exported stateless (functional) React components, improving readability in React DevTools and snapshot test output. It also adds `displayName` to function declarations and variable assignments. Last released in 2017, this plugin is stable and no longer actively updated. It works with Babel 6.x. Alternatives include using `@babel/plugin-transform-react-display-name` for Babel 7+.
npm install babel-plugin-transform-react-stateless-component-nameVerified import paths — ran on the pinned version, not inferred.
Shows adding the plugin to a .babelrc configuration file. No JavaScript import needed.
Use @babel/plugin-transform-react-display-name instead.
Use a different plugin or manually add displayName for named exports.
Update to v1.0.0 or later.
Update to v1.1.2 or later.
Run `npm install --save-dev babel-plugin-transform-react-stateless-component-name` and ensure it's in the plugins array.
This plugin is for Babel configuration, not runtime. Add to .babelrc without `require`.