From ab6e44b9f31b06fbf67511b54eb9752913d47831 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Mon, 26 Apr 2021 18:03:22 -0400 Subject: fixed background shadow issue --- src/components/common/BottomDrawer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/components/common/BottomDrawer.tsx') diff --git a/src/components/common/BottomDrawer.tsx b/src/components/common/BottomDrawer.tsx index 988c1e79..3d9c0471 100644 --- a/src/components/common/BottomDrawer.tsx +++ b/src/components/common/BottomDrawer.tsx @@ -6,7 +6,7 @@ import { View, ViewProps, } from 'react-native'; -import Animated, {interpolateColors} from 'react-native-reanimated'; +import Animated, {interpolateColors, useValue} from 'react-native-reanimated'; import BottomSheet from 'reanimated-bottom-sheet'; import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; @@ -23,7 +23,7 @@ const BottomDrawer: React.FC = (props) => { const {isOpen, setIsOpen, showHeader, initialSnapPosition} = props; const drawerRef = useRef(null); const [modalVisible, setModalVisible] = useState(isOpen); - const bgAlpha = new Animated.Value(isOpen ? 1 : 0); + const bgAlpha = useValue(isOpen ? 1 : 0); useEffect(() => { if (isOpen) { @@ -54,6 +54,7 @@ const BottomDrawer: React.FC = (props) => { inputRange: [0, 1], outputColorRange: ['rgba(0,0,0,0.3)', 'rgba(0,0,0,0)'], }); + return (