We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
useEffect()
1 parent bcb2fbb commit 1faedc8Copy full SHA for 1faedc8
src/components/Tooltip/Tooltip.tsx
@@ -115,7 +115,9 @@ const Tooltip = ({
115
116
const anchorById = document.querySelector(`[id='${anchorId}']`) as HTMLElement
117
if (anchorById) {
118
- setActiveAnchor({ current: anchorById })
+ setActiveAnchor((anchor) =>
119
+ anchor.current === anchorById ? anchor : { current: anchorById },
120
+ )
121
elementRefs.add({ current: anchorById })
122
}
123
0 commit comments