Learn what was the first vision of React suspense component and why it matters.Learn what was the first vision of React suspense component and why it matters.

The “Why” Behind React Suspense: Understanding the Original Vision

2025/10/22 12:41

Discover the why something was originally thought of makes us appreciate the tool + the way we use the tool as well as promote us to a couple of levels of we know what we are doing. It’s one of those inside job feeling.

I continuously invest in this quest, in this lightbulb moment when it comes to learning. Feeding mind with this gives us a right conceptual model of something. That way we can make and move things faster with accuracy. It's no brainer why right mental models are the ideal interface for holding essence of something.

Recently I’ve been fortunate enough to meet one such moment. It was really an eye-opening realization for me. So this is my attempt to write some words of my understanding. Optimistic you’ll find some values through this. It’s about React Suspense Component. Let’s dive in.

A very common theme we notice in applications is that they fetches and manipulate data that lives in a database. And there's a whole category of challenges of this and one of them is Data Fetching. How do we fetch Data or more preciously how do we fetch data with component driven framework like react. I deliberately bring component here because that's how most of us build products at least on the Frontend. \n

const res = await fetch("https://www.yourapp.com/users"); const data = await res.json();

Let’s talk about couple of cases that need to take care of this two lines of code. First noticeable case, between the await and fetch calls for getting data, there’s definitely going to be some delay. So need to handle the loading period. Other case would be what happens when calling doesn’t go well - maybe it’s a 404 or 500. Showing Loading & Showing Error are things we need to be aware of.

In react, the way we can do that is with use hook. Although It’s a versatile tool but let’s only focus on one thing here, data fetching. \n

function App() { return ( <div className="app"> <ErrorBoundary fallback={<div>Something went wrong</div>}> <Suspense fallback={<InvestmentSeekingLoading />}> <InvestmentSeekingBox /> </Suspense> </ErrorBoundary> </div> ) } const investmentSeekingPromise = getInvestmentSeeking() function InvestmentSeekingBox() { const data = use(investmentSeekingPromise); return <div>{/* Stuff using `data` */}</div>; }

So as we can see from the code, It takes a promise as a parameter. If we call this with a promise then component will stop it’s execution right off the bat and bubble up to a closest Suspense component and showed us the given loading spinners. And when the promise is resolved then react will unmount the loading fallback and start executing the component again but since the promise has been resolved so we don’t have to fall into the halting process again (this is also the reason we're not allowed to create the promise inside components otherwise every time we'll fall into the loading consequences again and again) instead it returns us the actual data this time and as a result showing it on the UI. but If the promise rejects then react will not try to render the component again instead it bubble up even more to find out an Error-Boundary and swap the loading with this.

Two steps does the job pretty cleanly: 1) wrap the component with Suspense and 2) prompt react to stop processing the rendering until the promise has resolved by throwing promise.

use hook throws a pending promise that we give. That's how component is able to communicate that it is not ready to render yet. Internally there's some mechanism inside React to catch that promise and suspend the render unless the promise resolves to render the components as this time promise is not pending so we got the actual data to work with.

After some time digesting this pattern, A question comes into my mind, why we need Suspense and Error-Boundary when dealing with loading and error. Can’t we handle these inside the component itself?

I mean "the thinking of component model" is, it’s A package, it should own it’s markup, it should own it’s styling, it should own it’s logic and it also should own it’s data fetching. No other components on the other side of the app should be able to meddling with this component. But with Suspense and Error-Boundary it’s not happening (sure data request is happens inside components but not loading and errors). If use hook gives us loading and error variable then it would be completely owned it’s own things component and satisfied the component definition. React did not design the API this way because there’s actually a real problem with this which is known as Layout Shift.

The way I was introduced to this from a tweet by andrew clark.

Spinners all around. The fact that component has to be highly cohesive, it has to contains and receive everything they need to render the UI is lead us to this problem of things shifted around on the initial load which not offers a good experience for the user. Each Component resolves data at different time, and so the problem arises.

Here we can see, each components for themselves, doing their own thing: \n

function InvestmentSeekingBox() { const { isLoading, data, error } = useQuery({ queryKey: ["InvestmentSeeking"], queryFn: getInvestmentSeeking, }); if (isLoading) { return <Spinner />; } return <div>{/* Stuff using `data` */}</div>; } function InvestmentVerificationBox() { const { isLoading, data, error } = useQuery({ queryKey: ["InvestmentVerification"], queryFn: getInvestmentVerification, }); if (isLoading) { return <Spinner />; } return <div>{/* Stuff using `data` */}</div>; } function Dashboard() { return ( <> <InvestmentSeekingBox /> <InvestmentVerificationBox /> </> ); }

Imagine 5 or 6 components on this Dashboard then components pushing other components will be visible clearly each time they finished their loading because different component finished their loading at different point in time because of asynchronous nature, like we saw in the tweet.

One way to avoid this experience is to hoist the data fetching to a common ancestor component and pass the data at once when all of the fetching is completed.

Here, Dashboard is in charge for all of the components to audit the Spinners mess: \n

function Dashboard() { const { isLoading: isInvestmentSeekingLoading, data: investmentSeekingData } = useQuery({ queryKey: ["InvestmentSeeking"], queryFn: getInvestmentSeeking, }); const { isLoading: isInvestmentVerificationLoading, data: investmentVerificationData } = useQuery({ queryKey: ["InvestmentVerification"], queryFn: getInvestmentVerification, }); // If *either* request is still pending, we'll show a spinner: if (isInvestmentSeekingLoading || isInvestmentVerificationLoading) { return <Spinner /> } return ( <div> <InvestmentSeekingBox data={investmentSeekingData} /> <InvestmentVerificationBox data={investmentVerificationData} /> </div> ) }

But this solution doesn’t go well with component mentality because the actual component that work with the data can not completely owned their data fetching logic. We'll lose that ergonomic of encapsulation here. Also as the data fetching requests increases, component would be bloated.

So in the first case when every components for themselves, on plus side, we get a great DX but on minus side elements were not being gentle.

Talk about second case, it's the opposite. We control the components of how they behave but components can not own their data requests.

Suspense offers the best of both worlds, an ideal sweet spot with an addition of much more declarative-ish. Now components can own their data requests and also we can control how they show up on initial load by wrapping them with Suspense Boundary, similar to “hoisting fetching up” strategy. Now the only thing is to decide which components are wrap around which Suspense Component and part of the same group so that layout shifting don’t happen. Some Careful thinking needs on this depending on the application.

So Loading and Error state is attached with Suspense, outside of individual components because of the strict isolation of components make the whole space of UI a disaster. With Suspense we still retains the isolation as major thing the data request is still rests with the components but without that baffling experience.

I hope I was able to convey my understanding about why suspense was originally created.

Warm thanks to Joshua Comeau, who taught me this eye-opening realization about Suspense original Vision. This is my reflection note of that WHY.

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.
Share Insights

You May Also Like

What is Ethereum’s Fusaka Upgrade? Everything You Need to Know

What is Ethereum’s Fusaka Upgrade? Everything You Need to Know

Over the past few weeks, one of the most talked-about topics within the crypto community has been Ethereum’s Fusaka upgrade. What exactly is this upgrade, and how does it affect the Ethereum blockchain and the average crypto investor? This article will be the only explainer guide you need to understand the details of this upgrade within the Ethereum ecosystem. Why Does Ethereum Undergo Upgrades? To understand what the Fusaka upgrade will achieve, it is essential to comprehend what Ethereum’s upgrades aim to accomplish. The layer-1 Ethereum network was originally designed as a proof-of-work (PoW) blockchain. This implied that miners were actively behind the block mining process. While this consensus mechanism ensured security for the L1 blockchain, it also triggered slower transactions. The Ethereum development team unveiled a detailed roadmap, outlining various upgrades that will fix most of the network’s issues. These problems include its scalability issue, which refers to the network’s ability to process transactions faster. Currently, the Ethereum blockchain processes fewer transactions per second compared to most blockchains using the proof-of-stake (PoS) consensus mechanism. Over the past decade, Ethereum’s developers have implemented most of these upgrades, enhancing the blockchain’s overall performance. Here is a list of the upgrades that Ethereum has undergone: Frontier: July 2015 Frontier Thawing: September 2015 Homestead: March 2016 DAO Fork: July 2016 Tangerine Whistle: October 2016 Spurious Dragon: November 2016 Byzantium: October 2017 Constantinople: February 2019 Petersburg: February 2019 Istanbul: December 2019 Muir Glacier: January 2020 Berlin: April 2021 London: August 2021 Arrow Glacier: December 2021 Gray Glacier: June 2022 The Merge: September 2022 Bellatrix: September 2022 Paris: September 2022 Shanghai: April 2023 Capella: April 2023 Dencun (Cancun-Deneb): March 2024 Pectra (Prague-Electra): May 2025 Most of these upgrades (forks) addressed various Ethereum Improvement Proposals (EIPs) geared towards driving the blockchain’s growth. For instance, the Merge enabled the transition from the PoW model to a proof of stake (PoS) algorithm. This brought staking and network validators into the Ethereum mainnet. Still, this upgrade failed to unlock the much-needed scalability. For most of Ethereum’s existence, it has housed layer-2 networks, which leverage Ethereum’s infrastructure to tackle the scalability issue. While benefiting from the L1 blockchain’s security and decentralization, these L2 networks enable users to execute lightning-fast transactions. Last year’s Dencun upgrade made transacting on layer-2 networks even easier with the introduction of proto-danksharding (EIP-4844). Poised to address the scalability issue, this upgrade introduces data blobs. You can think of these blobs as temporary, large data containers that enable cheaper, yet temporary, storage of transactions on L2 networks. The effect? It reduces gas fees, facilitating cheaper transaction costs on these L2 rollups. The Pectra upgrade, unveiled earlier this year, also included EIPs addressing the scalability issue plaguing the Ethereum ecosystem. The upcoming upgrade, Fusaka, will help the decade-old blockchain network to become more efficient by improving the blob capacity. What is Ethereum’s Fusaka Upgrade? Fusaka is an upgrade that addresses Ethereum’s scalability issue, thereby making the blockchain network more efficient. As mentioned earlier, Fusaka will bolster the blob capacity for layer-2 blockchains, which refers to the amount of temporary data the network can process. This will help facilitate faster transactions on these L2 scaling solutions. It is worth noting that upon Fusaka’s completion, users will be able to save more when performing transactions across layer-2 networks like Polygon, Arbitrum, and Base. The upgrade has no direct positive impact on the L1 blockchain itself. On September 18th, Christine Kim, representing Ethereum core developers, confirmed the launch date for Fusaka via an X post. Following an All Core Developers Consensus (ACDC) call, the developer announced that the Ethereum Fusaka upgrade will take place on December 3rd. Ahead of the upgrade, there will be three public testnets. Fusaka will first be deployed on Holesky around October 1st. If that goes smoothly, it will move to Sepolia on October 14th. Finally, it will be on the Hoodi testnet on October 28th. Each stage provides developers and node operators with an opportunity to identify and address bugs, run stress tests, and verify that the network can effectively handle the new features. Running through all three testnets ensures that by the time the upgrade is ready for mainnet, it will have been thoroughly tested in different environments. Crucial to the Fusaka upgrade are the Blob Parameter Only (BPO) forks, which will enhance the blob capacity without requiring end-users of the blockchain network to undergo any software changes. For several months, the Ethereum development team has been working towards unveiling the BPO-1 and BPO-2 forks. Blockchain developers have pooled resources to develop Fusaka through devnets. Following performances from devnet-5, developers within the ecosystem confirmed that the BPO upgrades will come shortly after the Fusaka mainnet debut. Approximately two weeks after the mainnet launch, on December 17th, the BPO-1 fork will increase the blob target/max from 6/9 to 10/15. Then, two weeks later, on January 7th, 2026, the BPO-2 fork is expected to expand capacity further to a metric of 14/21. Ultimately, the Fusaka upgrade would have doubled the blob capacity, marking a pivotal move for the Ethereum ecosystem. Impact on the Ethereum Ecosystem Admittedly, the Ethereum ecosystem is expected to see more developers and users join the bandwagon. With the introduction of faster and cheaper transactions, developers and business owners can explore more efficient ways to build on the L1 blockchain. This means we can see initiatives like crypto payment solutions and more decentralized finance (DeFi) projects enter the Ethereum bandwagon. Users, on the other hand, will benefit as they execute cheaper on-chain transactions. Despite the benefits from this initiative, some in the crypto community worry about the reduction in Ethereum’s gwei (the smallest unit of the Ether coin). Shortly after the Dencun upgrade, Ethereum’s median gas fee dropped to 1.7 gwei. Fast-forward to the present, and the median gas fee sits at 0.41 gwei, according to public data on Dune. This drop hints at the drastic reduction in gas fees, which could affect those staking their crypto holdings on the L1 blockchain, making it less attractive to stakers. Since the Fusaka upgrade aims to reduce the L2 network gas fee further, some observers may worry that crypto stakers will receive fewer block rewards. Time will tell if the Ethereum development team will explore new incentives for those participating in staking. Will Ether’s Price Pump? There is no guarantee that Ether (ETH) will jump following Fusaka’s launch in December. This is because the second-largest cryptocurrency saw no significant price movement during past major upgrades. According to data from CoinMarketCap, ETH sold for approximately $4,400 at the time of writing. Notably, the coin saw its current all-time high (ATH) of $4,900 roughly a month ago. The price pump was fueled by consistent Ether acquisitions by exchange-traded fund (ETF) buyers and crypto treasury firms. Source: CoinMarketCap Although these upgrades do not guarantee a surge in ETH’s price, they have a lasting impact on the underlying Ethereum blockchain. Conclusion Over the past 10 years, the Ethereum network has had no rest as it constantly ships out new upgrades to make its mainnet more scalable. The Fusaka upgrade aims to make Ethereum layer-2 networks cheaper to use. To ensure its smooth usage, several testnets are lined up. Stay tuned for updates on how Ethereum will be post-Fusaka. The post What is Ethereum’s Fusaka Upgrade? Everything You Need to Know appeared first on Cointab.
Share
2025/09/20 06:57
Share
President Trump’s Golden Bitcoin Statue Unveiled in Washington DC to Mixed Reaction ⋆ ZyCrypto

President Trump’s Golden Bitcoin Statue Unveiled in Washington DC to Mixed Reaction ⋆ ZyCrypto

The post President Trump’s Golden Bitcoin Statue Unveiled in Washington DC to Mixed Reaction ⋆ ZyCrypto appeared on BitcoinEthereumNews.com. Advertisement &nbsp &nbsp A large golden statue of Donald Trump holding a Bitcoin in his hand has been spotted in the nation’s capital. While many assumed that the statue itself was made under the orders of the 47th American president, it was actually constructed under the supervision of a group of cryptocurrency advocates, and they are calling it the “Donald J. Trump Golden Statue” (DJTGST) project. Trump is so far unaware of the development, but could respond to the development soon enough.  Where is the Artwork located? The commissioners describe the 12-foot statue of Trump holding the premier digital currency as a tribute to the “Bitcoin president” who helped the sector considerably. The artwork is of a temporary nature right now, as DC rules don’t permit permanent installations right outside the US Capitol, where it is being displayed right now.  “The installation is designed to ignite conversation about the future of government-issued currency and is a symbol of the intersection between modern politics and financial innovation,” said Hichem Zaghdoudi, who is a representative of the group.  There is no response from the White House till press time.  As usual, X (formerly Twitter) users immediately weighed in on the development and tweeted their opinion. One user posted: Advertisement &nbsp “This is the ugliest statue I have seen in my entire lifetime. I think Squid game doll with a bitcoin would have been more conveying of what this ugly sculpture does.” Another user pipped: “They can’t put Satoshi’s statue there, so this was the next best thing. Only in America smh.” But, perhaps the most nuanced take was from this user:“America never fails to mix politics with theater. a golden trump holding bitcoin outside the Capitol is peak symbolism” A large number of users also resorted to using AI LLMs…
Share
2025/09/20 01:56
Share