react脚手架 项目建立

官方:

npm install -g create-react-app

create-react-app my-app //创建react项目

cd my-app

rm -f src/*

 

Add a file named index.css in the src/ folder

Add a file named index.js in the src/ folder

Add these three lines to the top of index.js in the src/ folder:

import React from 'react'; import ReactDOM from 'react-dom'; import './index.css';

Now if you run npm start in the project folder and open http://localhost:3000 in the browser, you should see an empty tic-tac-toe field.

 

yo:

(推荐)

https://github.com/react-webpack-generators/generator-react-webpack

npm install -g generator-react-webpack

cd 目录

yo react-webpack 项目名字

///

https://github.com/stylesuxx/generator-react-webpack-redux

npm install -g generator-react-webpack-redux

npm install -g phantomjs-prebuilt

 

Setting up projects

# Create a new directory, and `cd` into it: mkdir my-new-project && cd my-new-project # Run the generator yo react-webpack-redux

Generating new reducers

yo react-webpack-redux:reducer my/namespaced/reducers/name yo react-webpack-redux:reducer items

Generating new actions

yo react-webpack-redux:action my/namespaced/actions/name yo react-webpack-redux:action addItem

Generating new components

yo react-webpack-redux:component my/namespaced/components/name yo react-webpack-redux:component button

Generating new containers

yo react-webpack-redux:container my/namespaced/container/Name yo react-webpack-redux:container wrapper

 

///

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值