From 40a0958e0d37c26cfe3ebbd4e5c8586dc3998240 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Nov 2022 10:06:14 +0000 Subject: [PATCH] Use useCallback Co-authored-by: Robin --- src/ListBox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ListBox.tsx b/src/ListBox.tsx index 175f459..f8de4bb 100644 --- a/src/ListBox.tsx +++ b/src/ListBox.tsx @@ -82,9 +82,9 @@ function Option({ item, state, className }: OptionProps) { // https://github.com/vector-im/element-call/issues/762 const origPointerUp = optionProps.onPointerUp; delete optionProps.onPointerUp; - optionProps.onClick = (e) => { + optionProps.onClick = useCallback((e) => { origPointerUp(e as unknown as React.PointerEvent); - }; + }, [origPointerUp]); return (