Advanced
Read a promise with use() and Suspense
fetchQuote() logs fetching quote and resolves to a quote string after 500 ms.
Start the request once, outside any component, and read it in Quote with React 19's use().
Wrap <Quote /> in <Suspense> with the fallback <p id="fallback">Loading quote...</p>. Quote renders the text in <blockquote id="quote">.
What Check tests
- The code uses
use(...)and a<Suspense>boundary - While the quote loads, only the
#fallbackis shown - The quote replaces the fallback
- The quote is fetched exactly once
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.