1.0.0 • Published 7 years ago

babel-plugin-transform-preact-h-to-jsx v1.0.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
7 years ago

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

Turn Preact.h 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-h-to-jsxJSX syntax)

Installation

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

Usage

Via .babelrc (Recommended)

.babelrc

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

Via CLI

$ babel --plugins transform-react-h-to-jsx script.js

Via Node API

import babel from 'babel-core'

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

Development

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