Lazy Loading Components and Data with React’s Suspense

Code Splitting with React.lazy and Suspense

  • Don't load your whole app up-front.
  • Load your components on demand, when they're needed.
  • Can significantly reduce initial load time.

Data Fetching with Suspense

  • Short explanation: Throw a promise during your render.
  • Caveat: This API will likely change in a future React release.

Resources

  • CodeSandbox Demo
  • Official Suspense docs
  • Official React.lazy docs
  • Bitovi's React Talks on YouTube
  • Bitovi React Consulting

Questions?