babel-plugin-react-create-element-require
v0.1.0
Published
Babel plugin that adds react's createElement import declaration
Downloads
321
Maintainers
Readme
babel-plugin-react-create-element-require
Babel plugin that adds react's createElement import declaration aliased as t
out of convention.
_(this repo was cloned from styled-components-require and modified to match needs.
Example
Your component.js
that contains this code:
const Component = t('div', null, 'hello world');
export default Component;
will be transpiled to:
import { createElement as t } from 'react';
const Component = t('div', null, 'hello world');
export default Component;
Usage
npm install babel-plugin-react-create-element-require --save-dev
Add react-create-element-require
into .babelrc
{
"plugins": ["react-create-element-require"]
}
You like?
:star: this repo
License
MIT © mciparelli