Skip to content

Commit

Permalink
fix(gorhom#1983): updated shared values access as hook dependancies
Browse files Browse the repository at this point in the history
  • Loading branch information
pinpong committed Oct 23, 2024
1 parent b7277d3 commit 5f406d1
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
);
}, [
_providedContainerHeight,
animatedContainerHeight.value,
animatedContainerHeight,
animatedHandleHeight,
animatedSnapPoints.value,
animatedSnapPoints,
handleComponent,
]);
const isInTemporaryPosition = useSharedValue(false);
Expand Down Expand Up @@ -433,10 +433,10 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
return SCROLLABLE_STATE.LOCKED;
}, [
enableContentPanningGesture,
animatedAnimationState.value,
animatedKeyboardState.value,
animatedScrollableOverrideState.value,
animatedSheetState.value,
animatedAnimationState,
animatedKeyboardState,
animatedScrollableOverrideState,
animatedSheetState,
]);
// dynamic
const animatedContentHeightMax = useDerivedValue(() => {
Expand Down Expand Up @@ -553,15 +553,15 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
return currentIndex;
}, [
android_keyboardInputMode,
animatedAnimationSource.value,
animatedAnimationState.value,
animatedContainerHeight.value,
animatedCurrentIndex.value,
animatedNextPositionIndex.value,
animatedPosition.value,
animatedSnapPoints.value,
isInTemporaryPosition.value,
isLayoutCalculated.value,
animatedAnimationSource,
animatedAnimationState,
animatedContainerHeight,
animatedCurrentIndex,
animatedNextPositionIndex,
animatedPosition,
animatedSnapPoints,
isInTemporaryPosition,
isLayoutCalculated,
]);
//#endregion

Expand Down Expand Up @@ -1499,8 +1499,8 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
};
}, [
enableDynamicSizing,
animatedContentHeight.value,
animatedContentHeightMax.value,
animatedContentHeight,
animatedContentHeightMax,
_providedOverrideReduceMotion,
_providedAnimationConfigs,
]);
Expand Down Expand Up @@ -1867,17 +1867,24 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
//#endregion

// render
if (__DEV__) {
print({
component: BottomSheet.name,
method: 'render',
params: {
animatedSnapPoints: animatedSnapPoints.value,
animatedCurrentIndex: animatedCurrentIndex.value,
providedIndex: _providedIndex,
},
});
}
useEffect(() => {
if (__DEV__) {
print({
component: BottomSheet.name,
method: 'render',
params: {
animatedSnapPoints: animatedSnapPoints.value,
animatedCurrentIndex: animatedCurrentIndex.value,
providedIndex: _providedIndex,
},
});
}
}, [
BottomSheet.name,
animatedSnapPoints,
animatedCurrentIndex,
_providedIndex,
]);

const DraggableView = enableContentPanningGesture
? BottomSheetDraggableView
Expand Down

0 comments on commit 5f406d1

Please sign in to comment.