Skip to content

Instantly share code, notes, and snippets.

@koba04
Last active January 16, 2017 12:22
Show Gist options
  • Save koba04/1f8ac9785606da700f95e823ce87a9fe to your computer and use it in GitHub Desktop.
Save koba04/1f8ac9785606da700f95e823ce87a9fe to your computer and use it in GitHub Desktop.
node_modules/
{
"name": "transform-react-constant-elements",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "babel test.js"
},
"babel": {
"presets": ["react"],
"plugins": [
"transform-react-constant-elements"
]
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-plugin-transform-react-constant-elements": "^6.9.1",
"babel-preset-react": "^6.16.0"
}
}
const ComponentA = () => <div><MyCustomComponent /></div>;
@koba04
Copy link
Author

koba04 commented Jan 16, 2017

➜  npm test

> [email protected] test /Users/koba04/transform-react-constant-elements
> babel test.js

var _ref = React.createElement(
  "div",
  null,
  React.createElement(MyCustomComponent, null)
);

const ComponentA = () => _ref;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment