5 hands-on exercises and 5 find-the-bug challenges for the Fetching Data lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Start in loading and switch to done once the data arrives.
Put the resolved value into state and show a field.
Catch a rejected promise and show the message.
Do not read a field before the data has arrived.
Treat a not-ok response as an error rather than data.
The promise resolves but nothing sets the state.
State holds the promise itself, not the resolved value.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceA rejected promise needs a catch, or the error is lost.
A not-ok response is treated as valid data.
Reading a field of null crashes; guard it first.