03
Sep
Based on big-react,I am going to implement React v18 core features from scratch using WASM and Rust. Code Repository:https://github.com/ParadeTo/big-react-wasm The tag related to this article:v24 Suspense is undoubtedly one of the most appealing features in the new version of React, so let's implement it ourselves. This article is the first part, focusing on implementing the Fallback rendering of Suspense. Consider the following code as an example: import { Suspense } from 'react'; export default function App() { return ( <Suspense fallback={<div>loading</div>}> <Child /> </Suspense> ); } function Child() { throw new Promise((resolve) => setTimeout(resolve, 1000)); } Enter fullscreen mode Exit…