Tag

useRef

1 views collected around this technical thread.

KooFE Frontend Team
KooFE Frontend Team
Mar 3, 2025 · Frontend Development

Customizing Markdown Rendering with react-markdown and useRef

This article demonstrates how to use react-markdown for personalized Markdown rendering, leveraging useRef to handle dynamic data updates and prevent unnecessary re‑renders, while providing full code examples and alternative implementation strategies.

JavaScriptcustom renderingfrontend
0 likes · 9 min read
Customizing Markdown Rendering with react-markdown and useRef
Code Mala Tang
Code Mala Tang
Jul 5, 2024 · Frontend Development

Mastering React refs: When and How to Use forwardRef, useRef, and useImperativeHandle

This article explains how React refs work with native elements, class components, and function components, demonstrates using useRef, forwardRef, and useImperativeHandle, and discusses the benefits, drawbacks, and alternative patterns for exposing component instances and DOM nodes.

ReactRefforwardRef
0 likes · 10 min read
Mastering React refs: When and How to Use forwardRef, useRef, and useImperativeHandle
KooFE Frontend Team
KooFE Frontend Team
Mar 28, 2023 · Frontend Development

Master React Refs: From DOM Access to Imperative APIs

Learn how to use React refs—including useRef, forwardRef, and useImperativeHandle—to access DOM elements, create custom imperative APIs, and build interactive forms with focus and shake effects, while understanding best practices for when to employ refs versus state or props.

ReactRefsforwardRef
0 likes · 14 min read
Master React Refs: From DOM Access to Imperative APIs
KooFE Frontend Team
KooFE Frontend Team
Jan 10, 2023 · Frontend Development

Mastering React Ref Callbacks: When and How to Use Them

This article explains the two meanings of React refs, how ref callbacks work during component mount and unmount, and presents four practical scenarios—scrolling, measuring, portal rendering, and sharing DOM elements—complete with code examples and best‑practice tips.

HooksJavaScriptReact
0 likes · 13 min read
Mastering React Ref Callbacks: When and How to Use Them
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Jun 3, 2021 · Frontend Development

Understanding Capture Value in React Hooks: Why State Updates Lag and How to Fix Them

This article explains the concept of Capture Value in React Hooks, demonstrates the issue with asynchronous state updates using a button example, and shows how to resolve it with useRef, while also providing a simplified custom hook implementation and deeper insight into hook internals.

Capture ValueFrontend DevelopmentHooks
0 likes · 6 min read
Understanding Capture Value in React Hooks: Why State Updates Lag and How to Fix Them