Skip to content

Commit 067cd01

Browse files
chore(lwd): update useRef typing on tooltip and dropdownselector
1 parent 018185e commit 067cd01

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/ledger-live-desktop/src/renderer/components/DropDownSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const DropDownSelector = <ContentType, Item extends DropDownItemType<ContentType
9494
},
9595
[controlled, onChange],
9696
);
97-
const triggerRef = useRef<HTMLDivElement>(null);
97+
const triggerRef = useRef<HTMLDivElement | null>(null);
9898
const renderOption = useCallback(
9999
(item: Item) => {
100100
return (

apps/ledger-live-desktop/src/renderer/components/Tooltip.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ const ToolTip = ({
5555
hideOnClick = true,
5656
containerStyle,
5757
}: Props) => {
58-
const triggerRef = useRef<HTMLDivElement>(null);
58+
const triggerRef = useRef<HTMLDivElement | null>(null);
5959
const colors = useTheme().colors;
6060
const bg = tooltipBg === "error-strong" ? colors.error.c50 : colors.neutral.c100;
6161
return (
6262
<>
6363
<ChildrenContainer ref={triggerRef} style={containerStyle}>
6464
{children}
6565
</ChildrenContainer>
66+
{/* Tippy's reference prop is typed RefObject<Element> (non-null); our ref is HTMLDivElement | null */}
6667
<Tippy
6768
{...defaultTippyOptions}
6869
reference={triggerRef as React.RefObject<Element>}

0 commit comments

Comments
 (0)