Home/Tutorials/React/JSX Basics

0 of 2 saved

React5 min read

JSX Basics

Read this chapter, then pass a short check to open the next one.

Markup in JavaScript.

JSX Basics

JSX looks like HTML inside JS. It compiles to React.createElement calls. Use className instead of class, and close every tag.

  • Embed expressions with { ... }.
  • Return one root element (or a fragment <>...).
  • JSX is not required but is the common style.

Quiz checks JSX rules โ€” Write stays quiz-only until a React sandbox ships.