{"id":19214,"library":"babel-plugin-transform-react-stateless-component-name","title":"babel-plugin-transform-react-stateless-component-name","description":"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+.","status":"maintenance","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/wyze/babel-plugin-transform-react-stateless-component-name","tags":["javascript","babel-plugin","transform","stateless","functional","component","displayname"],"install":[{"cmd":"npm install babel-plugin-transform-react-stateless-component-name","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-transform-react-stateless-component-name","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-transform-react-stateless-component-name","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for Babel plugin system","package":"babel-core","optional":false}],"imports":[{"note":"This is a Babel plugin, not a runtime import. It is configured in .babelrc or equivalent.","wrong":"const plugin = require('babel-plugin-transform-react-stateless-component-name')","symbol":"default","correct":"// No import needed; add to .babelrc plugins array"}],"quickstart":{"code":"{\n  \"plugins\": [\"transform-react-stateless-component-name\"]\n}","lang":"javascript","description":"Shows adding the plugin to a .babelrc configuration file. No JavaScript import needed."},"warnings":[{"fix":"Use @babel/plugin-transform-react-display-name instead.","message":"This plugin is designed for Babel 6.x and will not work with Babel 7 or later.","severity":"deprecated","affected_versions":">=7.0"},{"fix":"Use a different plugin or manually add displayName for named exports.","message":"Only adds displayName to default-exported stateless components, not to named exports or class components.","severity":"gotcha","affected_versions":">=0.0"},{"fix":"Update to v1.0.0 or later.","message":"v1.0.0 introduced breaking changes from previous non-existent versions; initial release.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Update to v1.1.2 or later.","message":"Plugin may crash on block-arrow components with HOC wrappers before v1.1.2.","severity":"gotcha","affected_versions":"<1.1.2"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev babel-plugin-transform-react-stateless-component-name` and ensure it's in the plugins array.","cause":"Plugin not installed or configured incorrectly.","error":"Error: Couldn't find a preset or plugin with the name 'transform-react-stateless-component-name'."},{"fix":"This plugin is for Babel configuration, not runtime. Add to .babelrc without `require`.","cause":"Trying to use `require` in an ES module environment.","error":"ReferenceError: require is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}