Skip to content

Commit 60d5ea1

Browse files
committed
comment cleanup effect
1 parent c2514e6 commit 60d5ea1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/Message/Message.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ const MessageWithContext = <
408408
const doubleTapRef = useRef<TapGestureHandler>(null);
409409
const pressActive = useSharedValue(false);
410410
const scale = useSharedValue(1);
411+
412+
/**
413+
* This is a cleanup effect to prevent the onLongPress
414+
* handler from being called if the component has dismounted.
415+
*/
411416
useEffect(
412417
() => () => {
413418
pressActive.value = false;

0 commit comments

Comments
 (0)