Tag

Custom Hook

1 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Mar 8, 2025 · Frontend Development

Introducing useWatchFields: A Vue 3 Custom Hook for Efficient Field Watching

This article presents the Vue 3 custom hook useWatchFields, which lets developers monitor specific fields of a large reactive state object with flexible, lightweight, and optionally debounced change detection, simplifying code compared to traditional watch and computed APIs.

Custom HookVueWatch
0 likes · 7 min read
Introducing useWatchFields: A Vue 3 Custom Hook for Efficient Field Watching
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 HookReact
0 likes · 6 min read
Understanding Controlled vs Uncontrolled Components and Implementing the usePropsValue Hook in React
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
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 5, 2023 · Frontend Development

Understanding useCallback and Building a Custom Countdown Hook in React

This article explores the purpose and proper usage of React's useCallback hook, examines common pitfalls, and demonstrates how to build and enhance a reusable countdown custom hook, including handling callbacks, effect dependencies, and ref-based solutions for stable function references.

Custom HookJavaScriptReact
0 likes · 8 min read
Understanding useCallback and Building a Custom Countdown Hook in React
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 30, 2022 · Frontend Development

Integrating Web Components into React Applications with a Custom Hook

This tutorial demonstrates how to use a previously built Web Components dropdown inside a React app, covering the creation of an abstraction layer, proper prop handling, event registration, and a reusable custom Hook that formats data and manages listeners.

Custom HookJavaScriptReact
0 likes · 15 min read
Integrating Web Components into React Applications with a Custom Hook
政采云技术
政采云技术
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