Use useCallback
Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
parent
098be75415
commit
40a0958e0d
1 changed files with 2 additions and 2 deletions
|
@ -82,9 +82,9 @@ function Option<T>({ item, state, className }: OptionProps<T>) {
|
||||||
// https://github.com/vector-im/element-call/issues/762
|
// https://github.com/vector-im/element-call/issues/762
|
||||||
const origPointerUp = optionProps.onPointerUp;
|
const origPointerUp = optionProps.onPointerUp;
|
||||||
delete optionProps.onPointerUp;
|
delete optionProps.onPointerUp;
|
||||||
optionProps.onClick = (e) => {
|
optionProps.onClick = useCallback((e) => {
|
||||||
origPointerUp(e as unknown as React.PointerEvent<HTMLElement>);
|
origPointerUp(e as unknown as React.PointerEvent<HTMLElement>);
|
||||||
};
|
}, [origPointerUp]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
|
|
Loading…
Reference in a new issue