Current section: Using JSX 59 exercises
Problem

Compiling JSX

Loading exercise

Transcript

00:00 In this exercise, we're going to be adding Babel to the page and converting our create element calls into JSX. So to add Babel to the page, you've got this little section here. We have Babel standalone in the public directory of the workshop repo, which is basically the entire Babel in a single script so that we can load that.

00:19 And then it will look through our page to find any scripts that have a special type on it, which you're going to be updating. Once it finds a type like that, it will take the contents of that script, compile it, and then take that compiled version, make a new script tag, and have the browser evaluate that for us. So that is your job in this exercise

00:38 is to set all that up and then convert stuff over to JSX. As a reminder, this is not the typical way that you run React applications, but I think that it's really valuable for you to see how all these pieces work in a single file like this without any extra tools around it.

00:56 You could take whatever you end up with in here and stick it anywhere else and it will work. So I think that's really valuable there. So have a good time with that and we will see you when you're done.