Tagged articles
3 articles
Page 1 of 1
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.

ReactforwardReffrontend
0 likes · 14 min read
Master React Refs: From DOM Access to Imperative APIs
政采云技术
政采云技术
Nov 24, 2020 · Frontend Development

Blending React Hooks with Class Components: Practical Patterns and Code

This article explains why mixing React Hooks with existing Class Components is often necessary, compares three integration techniques—Render Props, Higher‑Order Components, and Ref forwarding with useImperativeHandle—provides complete code examples for each, and discusses current Hook limitations and future support.

Class ComponentHigher-Order ComponentReact
0 likes · 11 min read
Blending React Hooks with Class Components: Practical Patterns and Code