Why Suspense will be a game changer

By Nikhil Sharma

Elevator Pitch

Suspense has been a buzz word now, and It’s a lot interesting than its hype as it paves a diff. a way for UX. In this talk, I won’t stick to the docs but focus more on the impact Suspense will have on us application developers in the way we think about loading states and architecture our apps.

Description

Seeing Suspense, it feels like (until now) we had the whole concept of dealing with loading states backward. They were always tightly coupled to the data source, which usually is tightly coupled to a specific data set or even component. Instead, Suspense now allows us to think of loading states as a UI concern. It becomes simple to define areas in your app that will deal with loading states, while at the same time cleaning up the code from verbosity and repetition, historical baggage we were carrying around for years.

This talk would cover the following sections with the help of a small example app representing a real-life scenario:- 1. Rating the methods like fetch-on-render, fetch-then-render, and render-as-you-fetch techniques 1.1. A brief description of what we did as developers 1.2. The Suspense way 1.3. Performance comparison 2. How suspense eradicates the problem of race conditions:- Race conditions are a very common problem that is frequently encountered in a react app, especially with data fetching. This section would show how suspense proves out to be a better alternative for this purpose