JSX and React elements

JSX can be defined as an extension for JavaScript that looks a whole lot like HTML. JSX can be used in React to create React elements. Basically, if you know HTML, you know JSX! In React docs, React elements are simply defined as a description of what you want to see on the screen.

React actually does not require JSX to work—you can replace JSX with some vanilla JavaScript. However, JSX is recommended when developing React applications, and is embraced by the vast majority of the React community. Let's look at some examples. 

Remember the Buy button from the products page?

This button is a visual element that we can ...

Get Hands-On Full Stack Development with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.