随笔分类 - React
摘要:const [state, dispatch] = useReducer(reducer, initialArg, init); The third arguement 'init' is a lazy initialization which is a function. It is useful
阅读全文
摘要:As a user, it can be very disorienting when the "wrong" UI is briefly shown to the user: a login link is shown to an authenticated user, or a 404 erro
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要:In this lesson we'll see an interesting situation where we're actually calling a function component and getting a dreaded React error: "Rendered fewer
阅读全文
摘要:Based on research at Facebook, we know that if a user sees a flash of loading state, they perceive the app as being slower. So let's improve the pendi
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要:Using Suspense within our component isn't exactly ergonomic. Let's put all that logic into a reusable function so we can create resources anytime we n
阅读全文
摘要:Let's get started with the simplest version of data fetching with React Suspense. It may feel a little awkward, but I promise you that you wont be wri
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要:Before we publish our package, we want to make sure everything is set up correctly. We’ll cover versioning, preparing our package, adding a proper REA
阅读全文
摘要:Similar to writing a custom State Hook, we’ll write our own Effect Hook called useStarWarsQuote, which returns a random quote and a loading state. Rem
阅读全文
摘要:Writing your own custom State Hook is not as a daunting as you think. To keep things simple, we'll refactor our text state value that uses useState an
阅读全文