Skip to content

Commit ae41b2d

Browse files
committed
fix(#1983): updated shared values access as hook dependancies
1 parent 4c8ae25 commit ae41b2d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/components/bottomSheet/BottomSheet.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
200200
return $modal
201201
? _animatedContainerHeight.value - verticalInset
202202
: _animatedContainerHeight.value;
203-
}, [topInset, bottomInset, $modal, _animatedContainerHeight.value]);
203+
}, [topInset, bottomInset, $modal, _animatedContainerHeight]);
204204
const animatedContainerOffset = useReactiveSharedValue(
205205
_providedContainerOffset ?? INITIAL_CONTAINER_OFFSET
206206
) as Animated.SharedValue<Insets>;
@@ -221,7 +221,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
221221
);
222222
const animatedHighestSnapPoint = useDerivedValue(
223223
() => animatedSnapPoints.value[animatedSnapPoints.value.length - 1],
224-
[animatedSnapPoints.value]
224+
[animatedSnapPoints]
225225
);
226226
const animatedClosedPosition = useDerivedValue(() => {
227227
let closedPosition = animatedContainerHeight.value;
@@ -231,10 +231,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
231231
}
232232

233233
return closedPosition;
234-
}, [animatedContainerHeight.value, $modal, detached, bottomInset]);
234+
}, [animatedContainerHeight, $modal, detached, bottomInset]);
235235
const animatedSheetHeight = useDerivedValue(
236236
() => animatedContainerHeight.value - animatedHighestSnapPoint.value,
237-
[animatedContainerHeight.value, animatedHighestSnapPoint.value]
237+
[animatedContainerHeight, animatedHighestSnapPoint]
238238
);
239239
const animatedCurrentIndex = useReactiveSharedValue(
240240
animateOnMount ? -1 : _providedIndex
@@ -1522,7 +1522,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
15221522
return {
15231523
paddingBottom: animatedContainerHeight.value,
15241524
};
1525-
}, [animatedContainerHeight.value, detached]);
1525+
}, [animatedContainerHeight, detached]);
15261526
const contentMaskContainerStyle = useMemo(
15271527
() => [styles.contentMaskContainer, contentMaskContainerAnimatedStyle],
15281528
[contentMaskContainerAnimatedStyle]
@@ -1581,7 +1581,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
15811581

15821582
evaluatePosition(ANIMATION_SOURCE.SNAP_POINT_CHANGE);
15831583
},
1584-
[isLayoutCalculated.value, animatedSnapPoints.value]
1584+
[isLayoutCalculated, animatedSnapPoints]
15851585
);
15861586

15871587
/**

src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const BottomSheetBackdropComponent = ({
106106
),
107107
flex: 1,
108108
}),
109-
[animatedIndex.value, appearsOnIndex, disappearsOnIndex, opacity]
109+
[animatedIndex, appearsOnIndex, disappearsOnIndex, opacity]
110110
);
111111
const containerStyle = useMemo(
112112
() => [styles.container, style, containerAnimatedStyle],

src/components/bottomSheetScrollable/createBottomSheetScrollableComponent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export function createBottomSheetScrollableComponent<T, P>(
116116
? animatedFooterHeight.value
117117
: 0,
118118
}),
119-
[animatedFooterHeight.value, enableFooterMarginAdjustment]
119+
[animatedFooterHeight, enableFooterMarginAdjustment]
120120
);
121121
const containerStyle = useMemo(() => {
122122
return enableFooterMarginAdjustment

0 commit comments

Comments
 (0)