What is the React Suspense component’s role in data fetching when used with libraries like Relay or React Query?

React Developer Hard

React Developer — Hard

What is the React Suspense component’s role in data fetching when used with libraries like Relay or React Query?

Key points

  • Suspense is triggered by components waiting for data
  • It catches Promises thrown by libraries during render
  • Shows a fallback until the Promise resolves

Ready to go further?

Related questions