From the course: React Essential Training

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Working with JSX syntax

Working with JSX syntax - React.js Tutorial

From the course: React Essential Training

Working with JSX syntax

- [Instructor] Right now within this app function, we are returning a little blip of JSX. So JSX or JavaScript is XML is a syntax that you can use to write HTML like syntax right here in a React component right here in a JavaScript file. So not only can this handle hardcoded text, but it also can handle variables. So let's go ahead and create, I'll say language, I'll say JavaScript. Now, if I wanted to take this value and place it into this string, I could. I'll just replace World with an open and closed curly brace, and then I'll say language. So now if I run this project again, npm run dev, this is going to take whatever that value is and dynamically insert it into that string, so that if I change it, it will change here too. This works with all sorts of different things. So we could say let moon equal, I'll hit Control, Command, space. That will open up my emoji keyboard. I can type moon here, and then plug that in as a string. And then add that in another set of curly braces…

Contents