From the course: Building Modern Projects with React
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Supporting ES6
- [Instructor] So we're going to be writing our React code using ES6 syntax and we're also going to need to add support for JSX, React's special HTML-like syntax for defining page layouts. And in order to do all this, we're going to start off by opening up a terminal inside our directory and running npm install --save-dev @babel/core @babel/cli @babel/preset-env and @babel/preset-react. And then we're going to hit enter. And that might take a little while to run. But once it does, the next thing we need to do is create a .babelrc file. This file will tell the Babel transpiler what presets and plugins to use to transpile our code. So let's create this .babelrc file in the root of our directory. Call it .babelrc. Don't forget the dot before it. And inside this file, we're going to define a JSON object. And this object will have a property presets that will be an array of two strings. The first one's going to be…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Building a React project from scratch1m 53s
-
The React entry point3m 10s
-
Supporting ES61m 46s
-
The Index.js file and app component3m 31s
-
Building and serving with webpack7m 15s
-
Hot-reloading with react-hot-loader3m 9s
-
Meet the sample app52s
-
Creating the todoList component1m 58s
-
Creating the todoListItem component2m 14s
-
Creating the newTodoForm component3m 29s
-
Putting the app together1m 59s
-
-
-
-
-
-
-