Skip to content

Commit

Permalink
fix(#1983): updated shared values access as hook dependancies
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Oct 20, 2024
1 parent 4c8ae25 commit ae41b2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
return $modal
? _animatedContainerHeight.value - verticalInset
: _animatedContainerHeight.value;
}, [topInset, bottomInset, $modal, _animatedContainerHeight.value]);
}, [topInset, bottomInset, $modal, _animatedContainerHeight]);
const animatedContainerOffset = useReactiveSharedValue(
_providedContainerOffset ?? INITIAL_CONTAINER_OFFSET
) as Animated.SharedValue<Insets>;
Expand All @@ -221,7 +221,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
);
const animatedHighestSnapPoint = useDerivedValue(
() => animatedSnapPoints.value[animatedSnapPoints.value.length - 1],
[animatedSnapPoints.value]
[animatedSnapPoints]
);
const animatedClosedPosition = useDerivedValue(() => {
let closedPosition = animatedContainerHeight.value;
Expand All @@ -231,10 +231,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
}

return closedPosition;
}, [animatedContainerHeight.value, $modal, detached, bottomInset]);
}, [animatedContainerHeight, $modal, detached, bottomInset]);
const animatedSheetHeight = useDerivedValue(
() => animatedContainerHeight.value - animatedHighestSnapPoint.value,
[animatedContainerHeight.value, animatedHighestSnapPoint.value]
[animatedContainerHeight, animatedHighestSnapPoint]
);
const animatedCurrentIndex = useReactiveSharedValue(
animateOnMount ? -1 : _providedIndex
Expand Down Expand Up @@ -1522,7 +1522,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
return {
paddingBottom: animatedContainerHeight.value,
};
}, [animatedContainerHeight.value, detached]);
}, [animatedContainerHeight, detached]);
const contentMaskContainerStyle = useMemo(
() => [styles.contentMaskContainer, contentMaskContainerAnimatedStyle],
[contentMaskContainerAnimatedStyle]
Expand Down Expand Up @@ -1581,7 +1581,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(

evaluatePosition(ANIMATION_SOURCE.SNAP_POINT_CHANGE);
},
[isLayoutCalculated.value, animatedSnapPoints.value]
[isLayoutCalculated, animatedSnapPoints]
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const BottomSheetBackdropComponent = ({
),
flex: 1,
}),
[animatedIndex.value, appearsOnIndex, disappearsOnIndex, opacity]
[animatedIndex, appearsOnIndex, disappearsOnIndex, opacity]
);
const containerStyle = useMemo(
() => [styles.container, style, containerAnimatedStyle],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function createBottomSheetScrollableComponent<T, P>(
? animatedFooterHeight.value
: 0,
}),
[animatedFooterHeight.value, enableFooterMarginAdjustment]
[animatedFooterHeight, enableFooterMarginAdjustment]
);
const containerStyle = useMemo(() => {
return enableFooterMarginAdjustment
Expand Down

0 comments on commit ae41b2d

Please sign in to comment.