1. 9
    Configure babel for React with preset-react
    3m 55s

Configure babel for React with preset-react

InstructorAndy Van Slaars

Share this video with your friends

Send Tweet

In this lesson, we'll add React and ReactDOM to our project and create an entry point for the React application. We'll also configure Babel with the React preset so Babel can transpile our JSX into JavaScript that will run in a browser.

Viktor Soroka
Viktor Soroka
~ 2 years ago

Nice lecture. It would be nice also to hear a few words about the order of presets inside presets array.

Sean O’Donnell
Sean O’Donnell
~ 2 years ago

Good stuff. Just a heads up, after following along with this tutorial, I was getting this error when doing npm run build:

ERROR in ./src/index.js
Module build failed (from /Users/seano/node_modules/babel-loader/lib/index.js):
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3".

Solved thusly:

npm install babel-loader babel-core@^7.0.0-bridge @babel/core --save-dev
Andy Van Slaars
Andy Van Slaars(instructor)
~ 2 years ago

Good stuff. Just a heads up, after following along with this tutorial, I was getting this error when doing npm run build

I'm not sure what you have installed or configured at this stage that would cause this error. This problem does come up later in the course and installing the babel-core bridge package is covered in: this video, covering testing React components with Jest