From the course: React for Web Designers
Unlock this course with a free trial
Join today to access over 22,500 courses taught by industry experts.
Start using JSX with the help of Babel - React.js Tutorial
From the course: React for Web Designers
Start using JSX with the help of Babel
- [Instructor] At this point, we have not been in the business of writing React code for very long. But you may already be getting tired of having to write React.createElement over and over and over again. Now, there are different ways to work around this. You could create a variable for React.createElement, say, rce. And then, you could write your functions like this instead of having to type that code out all the time. But there's another way to do that that the React community uses all the time, which is JSX. In this video, we're going to start using JSX and using the Babel transpiler in the browser so that we don't have to install any build tools to get the benefits of JSX and ES6 in our files. To do that, we're going to need a little bit of installation first. When I said that we weren't going to use any extra tools at all, that was sort of a half-truth because to get Babel running properly, we need to use a local web server instead of addressing our files over a local file URL…
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
-
-
-
-
Installing React on an existing site8m 7s
-
Identifying your components and data3m 19s
-
Set up first simple component5m 31s
-
Start using JSX with the help of Babel7m 57s
-
Attaching a data source3m 20s
-
Create a new component with array data5m 56s
-
Implement props4m 28s
-
Implement state with the useState hook5m 11s
-
Add the color selector component3m 27s
-
Change options, see reactions6m 14s
-
Challenge: Activate the color selector1m 58s
-
Solution3m 4s
-
-
-
-