Anything that loads in the background raises two questions. What does the user see while it loads, and what do they see if it fails? The usual answer is an effect that fetches the data and a few state flags for loading and error. Every component repeats that code, and the page fills up with spinners.
Suspense moves both questions out of the component. You wrap part of the page in a Suspense boundary that shows a loading fallback, and in an error boundary that shows a message. What turns Suspense on is a promise that is still pending. A component usually reads one with use. If the promise hasn’t resolved yet, use throws it, and that stops the component. React catches it, shows the nearest fallback and renders the component again once the promise resolves. lazy works the same way with a promise for code, and data libraries built for Suspense do the same for you. If the promise fails, the error boundary takes over. The component itself only handles the case where the data is there.
Once data is on screen, swapping it for a spinner each time it changes feels like a step back. Wrap the update in startTransition, and React keeps the old content visible while the new data loads. The isPending value from useTransition tells you new data is coming, so you can dim the old content. A search box is different, because the input must show what the user types right away. useDeferredValue gives the results a copy of the text that can lag behind, while the input stays current.
Some waits aren’t needed at all. When a user checks off a task, the request almost always succeeds. useOptimistic shows the new state right away while the request runs. When the request ends, React goes back to the real data, so a failed request undoes the change by itself.
Images have their own problem. When new data arrives, the browser keeps the old image until the new one downloads, so an old picture sits next to new text. You can load the image through a promise and let it suspend like data. Give the image its own Suspense boundary, so the new text can appear first. A key that changes with the image makes React show a placeholder in place of the old picture.
The biggest trap is a waterfall, where each request waits for the one before it. A component stops at its first use, so a request written below it only starts when the first one returns. A child also can’t start its requests until its parent has its data. Lazy-loaded code adds one more step, because the code must download before it can ask for anything.
The rule that matters most is to start every request before you read it. A promise created during render is new on every render, so the request starts again and React keeps showing the fallback. Start requests early, in a click handler, a route loader or a parent component, and keep the promises in a cache keyed by what you asked for. The component then reads the promise that is already on its way, and data the user already saw shows up right away.