const active = useActiveHeading(ids);
The id of the heading the reader is currently at.
It watches the headings rather than the scroll offset, so a short last section is
still reported as reached — the common failure of a scroll-position table of
contents.