Tag

useState

0 views collected around this technical thread.

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.

HooksReactfrontend
0 likes · 12 min read
When useState Becomes a Trap: Why useReducer Is the Better Choice
FunTester
FunTester
Jul 8, 2024 · Frontend Development

Learning React: From Prerequisites to Data‑Driven UI and Debugging Input Issues

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.

Data-Driven UIReactTypeScript
0 likes · 5 min read
Learning React: From Prerequisites to Data‑Driven UI and Debugging Input Issues
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
May 8, 2024 · Frontend Development

Understanding Controlled and Uncontrolled Components in React

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
Understanding Controlled and Uncontrolled Components in React
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.

FiberHooksJavaScript
0 likes · 8 min read
React Fiber Workflow and Hook Implementation Overview
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.

HooksReactperformance
0 likes · 16 min read
Advanced Tips and Common Pitfalls for React Hooks (useState, useEffect, useContext, useReducer, etc.)
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.

HooksJavaScriptReact
0 likes · 18 min read
Understanding React Hooks: Principles, Implementation, and Usage
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.

HooksJavaScriptReact
0 likes · 10 min read
Implementing React useState Hook from Scratch: Detailed Explanation and Code
政采云技术
政采云技术
Sep 8, 2019 · Frontend Development

Understanding and Using React Hooks: Concepts, Built‑in Hooks, and Custom Hook 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 HookHooksJavaScript
0 likes · 15 min read
Understanding and Using React Hooks: Concepts, Built‑in Hooks, and Custom Hook Development