From 6e04892e99bf1c6eb3fbdb2a47de444d759affcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CLilyL0u=E2=80=9D?= Date: Tue, 12 Nov 2024 17:52:29 +0000 Subject: [PATCH] change duplicate variable name --- src/app/components/JumpTo/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/components/JumpTo/index.tsx b/src/app/components/JumpTo/index.tsx index 5a0a84d76dc..c4adb56a622 100644 --- a/src/app/components/JumpTo/index.tsx +++ b/src/app/components/JumpTo/index.tsx @@ -71,8 +71,8 @@ const JumpTo = ({ jumpToHeadings, showRelatedContentLink }: JumpToProps) => {
    {jumpToHeadings?.map(({ heading, sanitisedId }) => { - sanitisedId = sanitisedId || idSanitiser(heading); - const idWithHash = `#${sanitisedId}`; + const id = sanitisedId || idSanitiser(heading); + const idWithHash = `#${id}`; const isActiveId = decodeURIComponent(hash) === idWithHash; return (
  1. @@ -80,7 +80,7 @@ const JumpTo = ({ jumpToHeadings, showRelatedContentLink }: JumpToProps) => { href={idWithHash} onClick={e => linkClickHandler(e, idWithHash)} css={styles.link} - data-testid={`jump-to-link-${sanitisedId}`} + data-testid={`jump-to-link-${id}`} >