babel-plugin-react-hyperscript
HyperScript syntax for React components without runtime overhead.
Compiles react-hyperscript into React.createElement
.
Example
Input
;
Output
React;
Installation
npm i babel-plugin-react-hyperscript
Plugin options
pragma
By default calls to h
will be replaced with React.createElement
, but you can override this with a custom pragma (including h
itself when used with Preact).
"plugins": "react-hyperscript" "pragma": "yo"
// Input; // Output;
Usage
Via .babelrc (Recommended)
.babelrc
Via CLI
babel --plugins react-hyperscript script.js
Via Node API
;
License
MIT