Skip to content

bootstarted/babel-plugin-react-rename

Repository files navigation

babel-plugin-react-rename

import path from 'path';

export default (componentName, {filename, cwd}) => {
  return path.relative(cwd, path.dirname(filename));
}
{
  "plugins": [
    ["babel-plugin-react-rename", {
      "only": "./src/component/**/*.js",
      "rename": "./config/babel/getComponentName.babel.js"
    }]
  ]
}

About

Automagically set your React component `displayName`.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published