Tagged articles
18 articles
Page 1 of 1
Code Mala Tang
Code Mala Tang
Mar 19, 2025 · Frontend Development

When useState Becomes a Trap: Why useReducer Is the Better Choice

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
When useState Becomes a Trap: Why useReducer Is the Better Choice
HelloTech
HelloTech
Jan 11, 2024 · Frontend Development

React Fiber Workflow and Hook Implementation Overview

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
React Fiber Workflow and Hook Implementation Overview
JD Cloud Developers
JD Cloud Developers
Mar 16, 2023 · Frontend Development

Demystifying React Hooks: Inside the Core Implementation

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
Demystifying React Hooks: Inside the Core Implementation
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Feb 13, 2023 · Frontend Development

Advanced Tips and Common Pitfalls for React Hooks (useState, useEffect, useContext, useReducer, etc.)

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
Advanced Tips and Common Pitfalls for React Hooks (useState, useEffect, useContext, useReducer, etc.)
KooFE Frontend Team
KooFE Frontend Team
Dec 15, 2022 · Frontend Development

How to Avoid Common React useState Mistakes and Write Cleaner Code

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
How to Avoid Common React useState Mistakes and Write Cleaner Code
Beike Product & Technology
Beike Product & Technology
Jan 7, 2022 · Frontend Development

Understanding React Hooks: Principles, Implementation, and Usage

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
Understanding React Hooks: Principles, Implementation, and Usage
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Jun 24, 2021 · Frontend Development

Mastering React Hooks: From Basics to Advanced Patterns

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
Mastering React Hooks: From Basics to Advanced Patterns
360 Tech Engineering
360 Tech Engineering
Aug 3, 2020 · Frontend Development

Implementing React useState Hook from Scratch: Detailed Explanation and Code

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
Implementing React useState Hook from Scratch: Detailed Explanation and Code
MaoDou Frontend Team
MaoDou Frontend Team
May 20, 2019 · Frontend Development

Mastering React Hooks: Practical Guide, Patterns, and Performance Tips

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
Mastering React Hooks: Practical Guide, Patterns, and Performance Tips