-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learn React with TypeScript
By :

In this section, we will learn about React Suspense and use it to implement a loading indicator in the RSCs that fetch data in our app. This will improve the loading user experience.
Currently, the data-fetching user experience in our app is reasonable because the process is quick. This is because everything is running locally, and so the latency is low. This is also because the database is small, and the queries are simple, so they execute fast. Lastly, we are the only user using the app.
When apps run on real servers with larger, more complex databases, queries will be a little slower – particularly when many users use the app.
Loading indicators let the user know that the app is loading the page, and they prevent the app from feeling laggy.
Before implementing a loading indicator, we will simulate a more significant data fetching delay. This will...