2025-04-18
3071
#react
Ovie Okeh
10496
116
Apr 18, 2025 â‹… 10 min read

How to handle data fetching with React Suspense

Ovie Okeh Programming enthusiast, lover of all things that go beep.

Recent posts:

Why Go wasn’t the right choice for the TypeScript compiler

Why Go wasn’t the right choice for the TypeScript compiler

The switch to Go may be a pragmatic move in the short term, but it risks alienating the very developers who built the tools that made TypeScript indispensable in the first place.

Muhammed Ali
May 8, 2025 â‹… 4 min read
how and when to use type casting in TypeScript

How and when to use type casting in TypeScript

Discover the basics and advanced use cases of type casting, how and why to use it to fix type mismatches, and gain some clarity on casting vs. assertion.

Paul Akinyemi
May 8, 2025 â‹… 14 min read

How to format dates in JavaScript: Methods, libraries, and best practices

JavaScript date handling can be tough. Here are some native Date API tools and specialized libraries to tackle them with.

Nelson Michael
May 8, 2025 â‹… 8 min read
tailwind typography

How to use the Tailwind Typography plugin

Walk you through how to set up and use the Tailwind Typography plugin, also known as the @tailwindcss/typography or the prose plugin.

David Omotayo
May 7, 2025 â‹… 7 min read
View all posts

6 Replies to "How to handle data fetching with React Suspense"

  1. While the hack is interesting (kudos for that)… It surely breaks the separation of concerns paradigm.

  2. Hey Ovie, great article!
    I was just wondering if you’d know how to convert the `wrapPromise` helper to the async/await syntax? I’ve been trying to do it but I’m not sure what to throw when the status is “pending”.

  3. Hey nice article, thanks. Nice trick the wrapPromise function. I haven’t tried yet. Thanks again and congratulations.

  4. i found this didnt work by assigning wrapPromise.status and wrapPromise.response as local variables because state was not retained between subsequent calls to wrapPromise.read(). This worked fine for me when I moved status and response to global scope.

Leave a Reply