We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d443859 commit c70e135Copy full SHA for c70e135
package/src/components/UIComponents/BottomSheetModal.tsx
@@ -1,4 +1,4 @@
1
-import React, { PropsWithChildren, useEffect } from 'react';
+import React, { PropsWithChildren, useEffect, useMemo } from 'react';
2
import {
3
Animated,
4
Keyboard,
@@ -50,13 +50,17 @@ export const BottomSheetModal = (props: PropsWithChildren<BottomSheetModalProps>
50
},
51
} = useTheme();
52
53
- const translateY = new Animated.Value(height);
+ const translateY = useMemo(() => new Animated.Value(height), [height]);
54
55
- const openAnimation = Animated.timing(translateY, {
56
- duration: 200,
57
- toValue: 0,
58
- useNativeDriver: true,
59
- });
+ const openAnimation = useMemo(
+ () =>
+ Animated.timing(translateY, {
+ duration: 200,
+ toValue: 0,
60
+ useNativeDriver: true,
61
+ }),
62
+ [translateY],
63
+ );
64
65
const closeAnimation = Animated.timing(translateY, {
66
duration: 50,
0 commit comments