Put in order · JavaScript and React course · Module 9: Modern React Hooks
use() with Suspense Flow
Arrange the steps of loading data with the use() hook and Suspense:
Items to put in order
- React suspends the component - Promise is unresolved
- Suspense boundary displays the fallback component
- After the Promise resolves, React renders the component with data
- Component receives a Promise with data as a prop
- Component calls use(promise) to read the value
You can check the correct answer by solving this task in the CodeWorlds game.