React foundations

What React is, components and rendering, the rules of JSX, and passing data with props and children.

About 4 hours of study

Learning objectives

Lessons

  1. 1

    What React is: components and rendering Intermediate

    What React does, how a page is built from components that are plain functions, how the App component is rendered into the page, and how React keeps the page in step with your data.

  2. 2

    JSX: HTML inside JavaScript Intermediate

    The rules of JSX: one root element or a fragment, JavaScript expressions in braces, className and other camelCase attributes, style objects, closing every tag, and how JSX becomes function calls.

  3. 3

    Props: passing data to components Intermediate

    How components receive data through props, destructuring props with default values, the special children prop, and why props are read-only.

Module practice

Module quiz

1. What is a React component?
2. How do you set an element's class in JSX?
3. What arrives in the children prop?
4. Why must every JSX tag be closed, as in <br />?
5. What does a fragment <>...</> add to the page?
6. Why must a component never change its props?

Rendering data and responding ›