CurriculumWeb development · Week 05

Week 05 / Components · props · state · lists · forms

Build the interface with React.

The idea

A React component is a reusable piece of interface. Props pass information in; state stores information that changes. When state changes, React updates the parts of the page that depend on it.

State updates a count

function Counter() {
  const [count, setCount] = useState(0);
  return (
    <button onClick={() => setCount(count + 1)}>
      Clicked {count} times
    </button>
  );
}

Build it

Work through these steps in your own project. Check them off as you go; your checklist stays in this browser.

Which information belongs in props, and which information changes while the page is open?

Notes save in this browser.