Level 4 · Full-Stack Application Development · Course 4.1 React Fundamentals
Module 33: State and Events
Goal: make your React app interactive: remember changing data with state, respond to events, control form inputs, and share state between components.
You'll need: your enquiries project from Module 32.
Lessons
- 1State with useState15–25 minutes✓
- 2Events15–25 minutes✓
- 3Updating state correctly15–25 minutes✓
- 4Controlled inputs15–25 minutes✓
- 5Lifting state up15–25 minutes✓
🛠️Module practice: an interactive enquiry dashboard
- Enquiries kept in state in
Dashboard. - Mark an enquiry as in progress or closed, with immutable updates.
- Search and status filter as controlled inputs, with a Clear button.
- A
Summarythat always matches the lists. - No state that can be calculated from other state. Commit.
✅Module check
Explain in a few sentences, in your own words:
What is state in React, how should it be updated, and where should it live?
Show a good answer
A good answer mentions: state is data a component remembers that can change; changing it with its setter makes React re-render the screen. Updates must create new arrays or objects (never change the existing ones), use updater functions when the new value depends on the old, and state should be kept minimal, with anything derivable calculated while rendering. Inputs are controlled by state. Shared state is lifted to the closest common parent and passed down as props, with changes sent up through callback props.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
