Results for “Refs & DOM interaction”
Small, practical examples. Search by task or narrow things down below.
Observe when a DOM node is attached
Observe when a DOM node is attached with a small React component and explicit browser behavior.
React✓ Tested
Focus an input through a ref
Focus an input through a ref with a small React component and explicit browser behavior.
React✓ Tested
Keep a mutable value without rendering on each write
Keep a mutable value without rendering on each write with a small React component and explicit browser behavior.
React✓ Tested
Open and close a native dialog
Open and close a native dialog with a small React component and explicit browser behavior.
React✓ Tested
Read an uncontrolled field through a ref
Read an uncontrolled field through a ref with a small React component and explicit browser behavior.
React✓ Tested
Remember the previously committed value
Remember the previously committed value with a small React component and explicit browser behavior.
React✓ Tested
Scroll a referenced element into view
Scroll a referenced element into view with a small React component and explicit browser behavior.
React✓ Tested
Select the contents of an input
Select the contents of an input with a small React component and explicit browser behavior.
React✓ Tested
Store and cancel a timer handle
Store and cancel a timer handle with a small React component and explicit browser behavior.
React✓ Tested
Read a DOM element through a viewChild signal
Read a DOM element through a viewChild signal with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Control a native dialog through a reference
Control a native dialog through a reference with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Focus an input through its template reference
Focus an input through its template reference with a standalone Angular component and explicit browser behavior.
Angular✓ Tested