diff --git a/packages/html-reporter/src/links.tsx b/packages/html-reporter/src/links.tsx index f4a5a48bc5..4beb7b65e0 100644 --- a/packages/html-reporter/src/links.tsx +++ b/packages/html-reporter/src/links.tsx @@ -133,12 +133,11 @@ export function useAnchor(id: AnchorID, onReveal: () => void) { }, [id, onReveal]); } -export function Anchor({ id, onReveal, children }: React.PropsWithChildren<{ id: AnchorID, onReveal?(): void }>) { +export function Anchor({ id, children }: React.PropsWithChildren<{ id: AnchorID }>) { const ref = React.useRef(null); const onAnchorReveal = React.useCallback(() => { - onReveal?.(); requestAnimationFrame(() => ref.current?.scrollIntoView({ block: 'start', inline: 'start' })); - }, [onReveal]); + }, []); useAnchor(id, onAnchorReveal); return
{children}
;