Tagged articles
useState
19 articles · Page 1 of 1
This article walks through twelve concrete TypeScript best‑practice patterns for React—covering props typing, avoiding React.FC, proper children and event types, useState and useRef inference, generic components, API‑driven type generation, strict mode, and utility types—to boost productivity and type safety.
PropsReactTypeScript
0 likes · 10 min read

This tutorial shows Python developers how to understand and use React (and Next.js) hooks by mapping each hook to familiar Python concepts such as closures, nonlocal variables, context managers, memoization, and async tasks, complete with side‑by‑side code examples.
Reacthooksnextjs
0 likes · 12 min read

This article explains why overusing useState in complex React components can lead to tangled code and bugs, and demonstrates how switching to useReducer provides a single source of truth, clearer actions, and more maintainable state management.
ReactState Managementfrontend
0 likes · 12 min read

The author recounts their recent journey into React, covering required fundamentals, challenges with TypeScript and input handling bugs, and how expert guidance clarified React's data‑driven design, ultimately improving their understanding and development approach.
ReactTypeScriptdata-driven UI
0 likes · 5 min read

This article explains the difference between controlled and uncontrolled components in React, illustrating when to use each approach, how defaultValue and value work, and provides practical code examples and a custom hook to support both modes in component development.
Controlled ComponentCustom HookReact
0 likes · 15 min read

This article explains React Hooks introduced in version 16.8, detailing the purpose and usage of common hooks such as useState, useEffect, useContext, useReducer, useRef, useCallback, and useMemo, and provides practical code examples for each.
Reactfrontendhooks
0 likes · 9 min read

React’s core fiber system traverses a depth‑first tree using performUnitOfWork, splits rendering into beginWork and completeWork, then commits in before‑mutation, mutation, and layout phases, while hooks like useState and useEffect are implemented via linked‑list queues that ensure deterministic updates and side‑effect handling.
FiberJavaScriptReact
0 likes · 8 min read

This article explains the core implementation of React Hooks introduced in React 16.8, covering the internal Hook manager, the built‑in Hook functions such as useState, useEffect, useReducer, and provides simplified code examples to illustrate how state and side‑effects are managed within function components.
JavaScripthooksuseEffect
0 likes · 9 min read

This article provides in‑depth guidance on using React hooks such as useState, useEffect, useContext, useReducer, and related utilities, covering lazy initialization, functional updates, performance‑optimising patterns, state sharing strategies, and advanced techniques like useImmer and react‑tracked to reduce mental overhead and avoid bugs.
Reacthooksperformance
0 likes · 16 min read

This article explains frequent misuse patterns of React's useState hook—redundant, duplicate, contradictory, and over‑reliance on useEffect—showing why they hurt readability and maintenance, and provides concise refactor solutions using derived state, IDs, and useReducer.
JavaScriptReactuseState
0 likes · 14 min read

This article explains why React function components were stateless before version 16, how the introduction of Fiber and the useState hook gave them state, and dives into the internal mechanisms—including renderWithHooks, hook queues, and update scheduling—that make state updates work in modern React.
FiberReactReact16
0 likes · 18 min read

This article explains why React introduced Hooks, how they solve state‑reuse and component‑complexity problems, details the internal fiber architecture behind useState, useReducer, useEffect, useLayoutEffect, useCallback and useMemo, and provides practical code examples for each.
JavaScriptReacthooks
0 likes · 18 min read

This article explains the three main reasons function components re‑render—useState/useReducer updates, parent updates, and context changes—and shows how to control unnecessary renders with techniques such as memoization, useCallback, useRef, and component extraction.
ReactReact.memofunction components
0 likes · 12 min read

This article explains why React Hooks were introduced, walks through the fundamentals of useState and useEffect with clear code examples, and demonstrates how Hooks simplify state management, side‑effects, and component logic compared to traditional class components, enabling more maintainable frontend development.
JavaScriptReactuseEffect
0 likes · 19 min read

This article explains the concept of Capture Value in React Hooks, demonstrates the issue with asynchronous state updates using a button example, and shows how to resolve it with useRef, while also providing a simplified custom hook implementation and deeper insight into hook internals.
Capture ValueReactuseRef
0 likes · 6 min read

This article explains how React’s functional nature, rooted in pure functions and side‑effect management, leads to the design of Hooks such as useState and useEffect, and walks through their implementation details and practical considerations.
Reactfrontendfunctional programming
0 likes · 13 min read

This article explains how to recreate the React useState hook by following the React source execution flow, describing the update mechanism, circular linked‑list queue, fiber storage, scheduling simulation, and differences from the official implementation, all illustrated with complete JavaScript code examples.
ReactState Managementhooks
0 likes · 10 min read


政采云技术Sep 8, 2019 · Frontend Development
This article introduces the concept of React Hooks, explains the built‑in hooks such as useState, useEffect, useCallback, useMemo, useRef, and useContext, demonstrates their usage with complete code examples, and guides readers on creating their own custom hooks for reusable logic in functional components.
Custom HookJavaScriptReact
0 likes · 15 min read

This article explains React Hooks introduced in version 16.8, their backward‑compatible design, how they replace class components, and provides detailed guidance on using useState, useEffect, custom hooks, useReducer, useRef, useMemo, useCallback, and related linting rules with performance‑focused examples.
JavaScriptReacthooks
0 likes · 16 min read
