React安装与项目搭建

React安装与项目搭建

有很多方式使用react,这里我选择安装react app,运行下面命令即可

1
cnpm install -g create-react-app

然后创建项目(在你的工作区文件夹下,其中的helloworld是项目名)

1
create-react-app helloworld

wWN1II.png

然后等五分钟就装好了^_^

wWaqVH.png

然后我们运行一下

进入项目,then run it!

1
2
cd helloworld
npm start

然后就在浏览器中打开了~

wWBnQP.png