Results for “point”
Small, practical examples. Search by task or narrow things down below.
Iterate over a fixed array of records
C: Compute the array element count with sizeof at the point where it is still an array.
C✓ Tested
Keep a callback stable between renders
Keep a callback stable between renders 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
Keep component state with useState
Keep component state with useState with a small React component and explicit browser behavior.
React✓ Tested
Keep numeric input text until conversion
Keep numeric input text until conversion with a small React component and explicit browser behavior.
React✓ Tested
Keep only the latest requested result
Keep only the latest requested result with a small React component and explicit browser behavior.
React✓ Tested
Keep separate state for separate hook calls
Keep separate state for separate hook calls with a small React component and explicit browser behavior.
React✓ Tested
Limit a value to a safe interval
Clamp an integer between chosen endpoints.
constrain✓ Tested
Mark a nonurgent state update as a transition
Mark a nonurgent state update as a transition with a small React component and explicit browser behavior.
React✓ Tested
Measure an element after layout
Measure an element after layout with a small React component and explicit browser behavior.
React✓ Tested
Memoize a component with stable props
Memoize a component with stable props with a small React component and explicit browser behavior.
React✓ Tested
Memoize a derived collection
Memoize a derived collection with a small React component and explicit browser behavior.
React✓ Tested