Tagged articles
27 articles
Page 1 of 1
FunTester
FunTester
Dec 24, 2025 · Frontend Development

Avoid Stale State and Race Conditions in React useEffect – Interview‑Ready Tips

This article dissects a common React interview snippet that uses useEffect for data fetching, exposing hidden pitfalls such as component unmount updates, request race conditions, and missing error handling, and then presents a robust solution with cleanup logic and proper error management.

AsynchronousReactState Management
0 likes · 8 min read
Avoid Stale State and Race Conditions in React useEffect – Interview‑Ready Tips
FunTester
FunTester
Dec 19, 2025 · Frontend Development

How to Detect and Fix Memory Leaks in React Applications

This guide explains why memory leaks occur in React, how to spot early warning signs, and provides step‑by‑step techniques—including Chrome DevTools, React DevTools, and proper cleanup of timers, event listeners, fetch requests, and refs—to prevent and resolve leaks for more stable applications.

Reactcleanupmemory leak
0 likes · 13 min read
How to Detect and Fix Memory Leaks in React Applications
Alibaba Cloud Developer
Alibaba Cloud Developer
Feb 2, 2024 · Frontend Development

When Should You Actually Use useEffect? 12 Cases to Avoid Overusing Effects

This article explains why useEffect in React is an "escape hatch" between functional and imperative code, outlines common pitfalls, provides twelve concrete scenarios where useEffect should be avoided or replaced, and offers best‑practice alternatives such as inline calculations, useMemo, event handlers, state lifting, and custom hooks.

ReactuseEffect
0 likes · 28 min read
When Should You Actually Use useEffect? 12 Cases to Avoid Overusing Effects
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
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 11, 2023 · Frontend Development

Deep Dive into React useEffect and useLayoutEffect: Data Structures, Lifecycle, and Implementation Details

This article explains how React manages side‑effects with useEffect and useLayoutEffect, covering the underlying Effect data structure, the mount and update phases, the commit pipeline (before‑mutation, mutation, layout), and the differences in timing and execution between the two hooks.

JavaScripthooksuseEffect
0 likes · 28 min read
Deep Dive into React useEffect and useLayoutEffect: Data Structures, Lifecycle, and Implementation Details
Huolala Tech
Huolala Tech
Apr 25, 2023 · Frontend Development

How to Solve Async Race Conditions and Caching in React with Custom Hooks

This article explains why React's synchronous component model struggles with async data fetching, demonstrates how to cancel stale requests, introduces a refetch‑only hook, and shows how to implement caching and deduplication to make queries pure functions, while recommending React Query and SWR for production use.

AsyncCustom HookReact
0 likes · 9 min read
How to Solve Async Race Conditions and Caching in React with Custom Hooks
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
Nov 10, 2022 · Frontend Development

How to Prevent Race Conditions When Fetching Data in React

This article explains why asynchronous data fetching in React can cause race conditions that lead to flickering or mismatched content, and presents several practical solutions—including component remounting, data validation, cleanup effects, and request cancellation—to ensure reliable UI updates.

AbortControllerData Fetchingrace condition
0 likes · 16 min read
How to Prevent Race Conditions When Fetching Data in React
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 9, 2022 · Frontend Development

Avoiding Race Conditions in React Data Fetching with Hooks, Boolean Flags, and useRequest

This article explains what race conditions are, demonstrates how they can occur in React components during asynchronous data fetching, and provides practical solutions using component lifecycle checks, boolean cancellation flags, the ahooks useRequest hook, and React Suspense to ensure correct UI updates.

race conditionuseEffectuseRequest
0 likes · 9 min read
Avoiding Race Conditions in React Data Fetching with Hooks, Boolean Flags, and useRequest
KooFE Frontend Team
KooFE Frontend Team
Oct 16, 2022 · Frontend Development

How to Optimize Data Fetching in React for Better Performance

Learn how to optimize data fetching in React by understanding initial vs on‑demand requests, avoiding waterfall patterns, leveraging Promise.all, parallel promises, data providers, and browser limits, while applying best practices for useEffect, lifecycle handling, and performance‑focused component design.

Data FetchingPromise.allReact
0 likes · 26 min read
How to Optimize Data Fetching in React for Better Performance
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
May 16, 2022 · Frontend Development

How to Prevent Race Conditions in React Data Fetching

This article explains what race conditions are in front‑end web development, demonstrates the issue with a React demo fetching articles, and walks through step‑by‑step solutions using custom hooks, useEffect cleanup, and AbortController to safely cancel outdated requests and avoid stale data rendering.

AbortControllerCustom HookData Fetching
0 likes · 10 min read
How to Prevent Race Conditions in React Data Fetching
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
KooFE Frontend Team
KooFE Frontend Team
Aug 11, 2021 · Frontend Development

How to Make React Effects Work Correctly in Strict Mode

This article explains how React's Strict Effects mode double‑invokes effects and layout effects during mount and unmount, and provides practical patterns using refs, cleanup functions, and focus management to ensure components behave correctly when effects run multiple times.

FocusReactRef
0 likes · 10 min read
How to Make React Effects Work Correctly in Strict Mode
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
Fulu Network R&D Team
Fulu Network R&D Team
Aug 10, 2020 · Frontend Development

Understanding the Execution Timing of useEffect and useLayoutEffect in React

This article explains the differences in execution timing between React's useEffect and useLayoutEffect hooks, analyzes their underlying mechanisms, demonstrates practical demos with performance monitoring, and delves into React's rendering process, scheduler, and related browser rendering concepts.

Browser RenderingReactuseEffect
0 likes · 12 min read
Understanding the Execution Timing of useEffect and useLayoutEffect in React
Youzan Coder
Youzan Coder
May 22, 2020 · Frontend Development

Why Does React Hooks Show Stale State? Unraveling Closures and Dependency Arrays

This article explores why React Hooks can display stale state values, comparing functional and class components, explaining closure behavior, dependency‑array mechanics, proper data‑fetching patterns, and when to replace useState with useReducer to avoid common pitfalls.

ReactState Managementfunctional components
0 likes · 13 min read
Why Does React Hooks Show Stale State? Unraveling Closures and Dependency Arrays
QQ Music Frontend Team
QQ Music Frontend Team
Dec 15, 2019 · Frontend Development

Inside React’s useEffect: A Deep Dive into the Fiber Source Code

This article dissects the inner workings of React's useEffect hook by tracing its implementation through the React Fiber architecture, from mountEffect and updateEffect functions to the commit phase, revealing how side‑effects are scheduled, created, and cleaned up in modern React applications.

FiberJavaScriptReact
0 likes · 18 min read
Inside React’s useEffect: A Deep Dive into the Fiber Source Code
Ctrip Technology
Ctrip Technology
Jul 18, 2019 · Frontend Development

React Hooks: From Mixins and HOCs to Custom Hook Implementations and Production Practices

This article explains the evolution of React component reuse—from legacy mixins and higher‑order components to modern React Hooks—provides step‑by‑step implementations of custom hooks such as useLogTime, useFetchHook, useInterval and useImgLazy, and demonstrates how to apply them in real‑world production code for better performance and maintainability.

CustomHookHOCReact
0 likes · 22 min read
React Hooks: From Mixins and HOCs to Custom Hook Implementations and Production Practices
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
UC Tech Team
UC Tech Team
Dec 26, 2018 · Frontend Development

Reflections on the Design, Implementation, and Future of React Hooks

The article provides a comprehensive analysis of React Hooks, covering their injection model, persistent call ordering, debugging and testing strategies, API design considerations such as useReducer, Context Provider, useEffect, missing APIs, type handling, compilation optimizations, safety concerns, and the overall motivation behind moving from class components to hooks.

DebuggingReactapi-design
0 likes · 21 min read
Reflections on the Design, Implementation, and Future of React Hooks