JSPM

babel-plugin-transform-react-createelement-to-jsx

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14701
  • Score
    100M100P100Q161078F
  • License GPL-3.0

Transforms React.createElement calls to JSX syntax

Package Exports

  • babel-plugin-transform-react-createelement-to-jsx

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-transform-react-createelement-to-jsx) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

.babelrc

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

Via CLI

$ babel --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: