Skip to content

flying-sheep/babel-plugin-transform-react-createelement-to-jsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-transform-react-createelement-to-jsx build status npm version

Turn React.createElement calls back into JSX syntax.

This is useful for

  1. Converting projects that started out in the opinion that “we need no stinking compilers”
  2. Converting already-compiled JS into something maintainable (E.g. CJSX syntax → coffee-react-transformdecaffeinatereact-createelement-to-jsxJSX syntax)

Installation

$ npm install babel-plugin-transform-react-createelement-to-jsx

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": [ "transform-react-createelement-to-jsx" ]
}

Via CLI

$ babel --no-babelrc --plugins transform-react-createelement-to-jsx script.js

Via Node API

import babel from '@babel/core'

babel.transform('code', {
  plugins: ['transform-react-createelement-to-jsx'],
})

Development

If you want to help with corner cases, here are helpful resources:

About

↩️ Transforms React.createElement calls to JSX syntax

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •