Utils name
A short, one-line description of what the hook does.
Usage
Describe the basic import and the minimal usage example. Always show destructured return values in the usage snippet (even if a full object is returned). If the utils supports alternative inputs or overloads (like tuple values or options), show a second short example. If the hook accepts a target, show both variants: with returned ref and with an explicit target argument.
Example
Provide a concise component example that demonstrates a real UI use case and how the hook’s return values are used in JSX.
Use cases
List 2-4 concise, real UI scenarios where the hook is useful. Keep each bullet short and practical (ex: tracking visibility for lazy loading, reacting to page focus changes).
Notes
List important caveats and edge cases:
- uses browser APIs (if applicable)
- any usage specifics or gotchas to be aware of
Type Declarations
Summarize the key public types and the main function signature. Keep it short and focused on what callers need to know.