Beginning React
上QQ阅读APP看书,第一时间看更新

How to Set up a React-Based Application

React is a JavaScript library, so we should be able to make a reference to it through a <script> tag in our HTML page and start writing our web application. However, this approach would prevent us from exploiting some features that are provided by a modern JavaScript development environment—features that make our lives easier. For example, we wouldn't be able to use recent features from ECMAScript 2015+, such as classes, modules, arrow functions, let and const statements, and so on. Or, we could use those features, but only recent browsers would support them.

The relationship of ECMAScript with JavaScript

Using the latest ECMAScript features requires a true development environment, allowing us to transpile our code into ECMAScript 5 version JavaScript code, so that even older browsers will be able to run our application. Setting up a modern JavaScript development environment requires the installation and configuration of a few tools: a transpiler, a syntax checker, a module bundler, a task runner, and so on. Learning to use these tools properly requires a lot of time, even before starting to write a single line of code.