A Babel 7 plugin that automatically adds displayName to React components, including ES6 class components and stateless functional components returning JSX. Version 0.0.6-beta is the latest stable release. The plugin helps ensure meaningful component names appear in React DevTools and production builds. Unlike other solutions, it focuses solely on displayName addition and works alongside Babel's built-in support for React.createClass. Maintained by paradoxxxzero as a fork of the original plugin updated for Babel 7 compatibility.
npm install babel-plugin-add-react-displayname-babel7No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installation and configuration of the plugin along with a simple functional component that automatically gets a displayName.
Ensure 'add-react-displayname' appears before 'transform-decorators-legacy' in the plugins list.
Install @babel/preset-react and add it to your Babel config: { "presets": ["@babel/preset-react"] }Add import React from 'react' or use the new JSX transform (React 17+).
No dependency data recorded yet.