您的位置:首页 > 移动开发

[Poi] Customize Babel to Build a React App with Poi

2018-01-03 03:10 113 查看
Developing React with Poi is as easy as adding the
babel-preset-react-app
to a .babelrc and installing React. This lesson will walk you through that quick process and get your React app up-and-running.

Install:

npm i react react-dom babel-preset-react-app babel-plugin-react-require


.babelrc:

{
"presets": [
"react-app"
],
"plugins": [
"react-require"
]
}


index.js:

// import React from 'react'; // NO NEED because babel-plugin-react-require

import {render} from 'react-dom';

render(<h1>React</h1>, document.getElementById("app"))


Run:

poi
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐