Skip to content

jamiebuilds/babel-utils-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-utils-react

Utility functions for building Babel plugins for React code

Example

import reactUtilsFactory from 'babel-utils-react';

export default function ({Plugin, types: t}) {
  const reactUtils = reactUtilsFactory(t);

  return new Plugin('ast-transform', {
    visitor: {
      ClassDeclaration(node) {
        if (reactUtils.isReactComponentClassDeclaration(node)) {
          // Yay, a React.Component class!
        }
      }
    }
  });
}

Installation

$ npm install babel-utils-react

About

Utility functions for building Babel plugins for React code

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors