Tagged articles
15 articles
Page 1 of 1
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 2, 2024 · Frontend Development

Understanding Vue 3 ref, computed, and reactive: Definitions, Usage, and Best Practices

This article explains the purpose and internal implementation of Vue 3’s ref, computed, and reactive APIs, compares their behaviours in script and template contexts, discusses watch strategies, and offers practical guidelines for choosing and modularising these reactive primitives in large‑scale frontend projects.

RefVue3computed
0 likes · 16 min read
Understanding Vue 3 ref, computed, and reactive: Definitions, Usage, and Best Practices
Alibaba Cloud Developer
Alibaba Cloud Developer
Aug 9, 2024 · Frontend Development

Mastering useRef in React with TypeScript: Avoid Common Pitfalls

This article explains how to correctly use React's useRef hook with TypeScript across several real‑world scenarios, compares different initialization patterns, highlights typical mistakes with useLayoutEffect, and provides best‑practice solutions for forwarding refs, merging refs, and exposing imperative handles.

FrontendReActRef
0 likes · 13 min read
Mastering useRef in React with TypeScript: Avoid Common Pitfalls
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 2, 2023 · Frontend Development

Why ref Is Preferred Over reactive in Vue 3: Limitations of reactive and Best Practices

This article explains the fundamental differences between Vue 3's reactive and ref APIs, highlighting reactive's limitation to objects, the situations where it loses reactivity, and why using ref—along with techniques like Object.assign and toRefs—provides more reliable and flexible state management.

FrontendJavaScriptRef
0 likes · 10 min read
Why ref Is Preferred Over reactive in Vue 3: Limitations of reactive and Best Practices
php Courses
php Courses
Dec 12, 2021 · Frontend Development

Understanding Vue 3 Composition API: Ref, Reactive, toRefs, Computed, Watch, Provide/Inject, and Lifecycle Hooks

This article explains Vue 3's Composition API, covering how to create reactive data with ref and reactive, use toRefs, define computed properties, apply readonly, watch and watchEffect, handle lifecycle hooks, pass props, and share state via provide and inject, all with practical code examples.

Composition APIJavaScriptRef
0 likes · 8 min read
Understanding Vue 3 Composition API: Ref, Reactive, toRefs, Computed, Watch, Provide/Inject, and Lifecycle Hooks
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