[React] Set up React apps with zero configuration
The React team has an official Command Line Interface (CLI) for building React projects called "Create React App"; in this lesson, we show how to use this tool to quickly set up new projects using the create-react-app {project-name}command. We then use the npm scripts that are provided: npm start to develop, npm run build to ship, and npm run eject to opt out of the abstracted tooling.
The benefits of this tool are:
- It's officially maintained by the React team; this means best practices out of the box
- Zero config, one dependency
- Config is abstracted so React team can make improvements under the hood and you get the new goodness for free
- Clean command line output for errors
- You can "eject" at any time if needed
Install:
npm install -g create-react-app
Create a new app:
create-react-app react-start
Remove react-scripts:
npm run eject
This will remove the react-script and back to normal.
[React] Set up React apps with zero configuration的更多相关文章
- WHAT IS THE DIFFERENCE BETWEEN REACT.JS AND REACT NATIVE?
Amit Ashwini - 09 SEPTEMBER 2017 React.js was developed by Facebook to address its need for a dynami ...
- 七天接手react项目 系列 —— react 脚手架创建项目
其他章节请看: 七天接手react项目 系列 react 脚手架创建项目 前面我们一直通过 script 的方式学习 react 基础知识,而真实项目通常是基于脚手架进行开发. 本篇首先通过 reac ...
- react系列从零开始-react介绍
react算是目前最火的js MVC框架了,写一个react系列的博客,顺便回忆一下react的基础知识,新入门前端的小白,可以持续关注,我会从零开始教大家用react开发一个完整的项目,也会涉及到w ...
- [react] 细数 React 的原罪
Props & onChange 的原罪 .「props & onChange 接口规范」它不是一个典型的「程序接口规范」. 当你拿到一个可视组件的 ref,却没有类似 setProp ...
- React Native & react-native-web-player & React Native for Web
React Native & react-native-web-player & React Native for Web https://github.com/dabbott/rea ...
- React笔记:React基础(2)
1. JSX JSX是一种拥有描述UI的JavaScript扩展语法,React使用这种语法描述组件的UI. 1.1 基本语法 JSX可以嵌套多个HTML标签,可以使用大部分符号HTML规范的属性. ...
- [React] 从零开始的react
组件 1. 无状态组件 在React中,组件的名字必须用大写字母开头,而包含该组件定义的文件名也应该是大写字母(便于区分,也可以不是). 无状态组件是纯展示组件,仅仅只是用于数据的展示,只根据传入的p ...
- React 学习(一) ---- React Element /组件/JSX
学习React的时候,你可能听到最多的就是要先学习webpack, babel,要先学会配置然后才能学react 等等,一堆的配置就把我们吓着了,根本就没有心情就学习react了.其实在最开始学习re ...
- React.createClass 、React.createElement、Component
react里面有几个需要区别开的函数 React.createClass .React.createElement.Component 首选看一下在浏览器的下面写法: <div id=" ...
- 【React】初识React
React是什么 React是如今(2015年)最热门的前端技术. 在React中.一切皆组件. A JavaScript library for building user interfaces R ...
随机推荐
- JSOI2014第三轮总结
这次发挥的比上次好很多 毕竟这次的话好歹上100了,也不是特别丢人 但更主要的是,该得的分没有丢(不禁想到了R1的线段树和R2的网络流,可惜啊) 不会做的题目积极去骗分了(如D1T1,2和D2T1) ...
- eclipse中相同代码的高亮显示
在eclipse中 当选中一串字符时,让其他相同字符代码都高亮显示,操作如下: windows-> preferences-> java-> Editor-> Mark Occ ...
- 【转】如何在Ubuntu11.10(32位)下编译Android4.0源码(图文)
原文网址:http://blog.csdn.net/flydream0/article/details/7046612 关于如何下载Android4.0的源码请参考我的另一篇文章: http://bl ...
- ejabberd中的http反向推送
http的反向推送通常使用"长轮询"或"长连接"的方式. 所谓"长轮询"是指客户端发送请求给服务器,服务器发现没有数据需要发送给客户端. h ...
- web.xml 配置的详解
http://my.oschina.net/u/1383439/blog/224448 http://blog.csdn.net/guihaijinfen/article/details/836383 ...
- MVC 实现计算页面执行时间
使用 ActionFilterAttribute 来实现: public class PerformanceActionAttribute:ActionFilterAttribute { public ...
- python bisect模块
转发:http://www.cnblogs.com/skydesign/archive/2011/09/02/2163592.html 先看看模块的结构: 前面五个属性大家感兴趣可以打出来看看数值,这 ...
- Bzoj 4403: 序列统计 Lucas定理,组合数学,数论
4403: 序列统计 Time Limit: 3 Sec Memory Limit: 128 MBSubmit: 328 Solved: 162[Submit][Status][Discuss] ...
- NetAdvantage
1.LC.exe的问题 ⇒非正式版,删除licenses.licx文件 2.項目 "obj\Debug\BasicFeaturesSample.Form1.resources" は ...
- rabbitMQ 笔记
1. 端口 rabbitMQ server 使用的端口是5672 , AMQP协议的端口 rabbitMQ web 使用的端口是15672 , 管理工具的端口 rabbitMQ cl ...