Measure the on-screen caret rect for textarea at index (default: the current selectionStart).
Uses a hidden mirror div — pass a persistent one (the hook does) to avoid per-call DOM churn; omit it
and a transient mirror is created + removed. Returns a zero-size rect at the origin when there is no
DOM / element (SSR-safe).
Measure the on-screen caret rect for
textareaatindex(default: the currentselectionStart). Uses a hidden mirror div — pass a persistent one (the hook does) to avoid per-call DOM churn; omit it and a transient mirror is created + removed. Returns a zero-size rect at the origin when there is no DOM / element (SSR-safe).