Tagged articles
11 articles
Page 1 of 1
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 5, 2025 · Frontend Development

Understanding Controlled vs Uncontrolled Components and Implementing the usePropsValue Hook in React

The article explains the difference between controlled and uncontrolled React components, introduces the usePropsValue custom hook to unify their handling, provides implementation details with code examples, and discusses optimization techniques to reduce unnecessary re-renders.

Controlled ComponentCustom HookPerformance Optimization
0 likes · 6 min read
Understanding Controlled vs Uncontrolled Components and Implementing the usePropsValue Hook in React
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
Huolala Tech
Huolala Tech
Nov 23, 2022 · Frontend Development

Sync React Component State Without Heavy Libraries: Custom Hook & Pub‑Sub

This article explains how to synchronize state across distant React components without relying on heavy libraries, using a custom hook and a publish‑subscribe model, and discusses optimizations such as avoiding redundant updates and incorporating a simple reducer for efficient change detection.

Custom HookReactRedux
0 likes · 7 min read
Sync React Component State Without Heavy Libraries: Custom Hook & Pub‑Sub
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
KooFE Frontend Team
KooFE Frontend Team
Apr 17, 2022 · Frontend Development

Master Global State Management in React with Custom Hooks

Learn how to build a simple global state management solution in React using custom hooks, starting from a basic counter component, extending it with initialization props, synchronizing multiple counters, and finally creating a reusable createGlobalState utility for shared state across components.

Custom HookReactfrontend development
0 likes · 9 min read
Master Global State Management in React with Custom Hooks
Alibaba Cloud Developer
Alibaba Cloud Developer
Aug 30, 2021 · Frontend Development

Can Design Patterns Make Your React Hooks More Elegant?

This article explores how classic design patterns and solid principles can be applied to React Hooks development, demonstrating with Context, custom global state, useState vs useReducer, and custom hook composition to improve code maintainability and reduce unnecessary re‑renders.

Custom HookState Managementhooks
0 likes · 16 min read
Can Design Patterns Make Your React Hooks More Elegant?