Skip to content

Commit c70e135

Browse files
committedApr 2, 2025
fix: bottom sheet closing on received reaction
1 parent d443859 commit c70e135

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed
 

‎package/src/components/UIComponents/BottomSheetModal.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropsWithChildren, useEffect } from 'react';
1+
import React, { PropsWithChildren, useEffect, useMemo } from 'react';
22
import {
33
Animated,
44
Keyboard,
@@ -50,13 +50,17 @@ export const BottomSheetModal = (props: PropsWithChildren<BottomSheetModalProps>
5050
},
5151
} = useTheme();
5252

53-
const translateY = new Animated.Value(height);
53+
const translateY = useMemo(() => new Animated.Value(height), [height]);
5454

55-
const openAnimation = Animated.timing(translateY, {
56-
duration: 200,
57-
toValue: 0,
58-
useNativeDriver: true,
59-
});
55+
const openAnimation = useMemo(
56+
() =>
57+
Animated.timing(translateY, {
58+
duration: 200,
59+
toValue: 0,
60+
useNativeDriver: true,
61+
}),
62+
[translateY],
63+
);
6064

6165
const closeAnimation = Animated.timing(translateY, {
6266
duration: 50,

0 commit comments

Comments
 (0)