Handling Data at Scale for React Developers – Tejas Kumar, React Summit 2022

Handling data at scale in React applications, a chaotic and performance-critical topic. Learn the 3 methods of data fetching, the benefits of React's suspense feature and how to write efficient code for a better user experience.

Key takeaways
  • The importance of handling data at scale in React applications, which can be chaotic and lead to performance issues.
  • There are three ways to fetch data in React: fetch then render, render as you fetch, and suspense.
  • Fetch then render involves fetching data and then rendering the component, which can lead to a poor user experience.
  • Render as you fetch involves rendering the component while fetching data, which can be beneficial but may not always work as expected.
  • Suspense is a new feature in React 18 that allows for more fine-grained control over data fetching, enabling developers to specify where and when data should be loaded.
  • Suspense can be used to create a resilient data fetching system that can handle errors and interruptions.
  • Another approach to data fetching is to use a library like Next.js, which provides a built-in solution for client-side rendering and data fetching.
  • The importance of understanding how React works under the hood and how to write efficient code to improve performance.
  • Common pitfalls to watch out for when dealing with data fetching in React, such as the use of async/await and the creation of unresolved promises.
  • The benefits of using React’s concurrent features, such as suspense, which allow for more efficient data fetching and improved user experience.
  • The importance of testing and debugging data fetching code to ensure it is working correctly and efficiently.