From 02436c6aafc1306ee1ea8628e860e30ab67e9f6a Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 19 Nov 2024 14:18:11 +0100 Subject: [PATCH] drop onreveal --- packages/html-reporter/src/links.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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}
;