Skip to content

Commit

Permalink
fix(#1983): updated shared values access as hook dependancies (#1992)…
Browse files Browse the repository at this point in the history
…(by @pinpong)

* fix(#1983): updated shared values access as hook dependancies

* chore: removed render message

---------

Co-authored-by: Mo Gorhom <gorhom.dev@gmail.com>
  • Loading branch information
pinpong and gorhom authored Oct 26, 2024
1 parent 13c7d47 commit 9757bd2
Showing 1 changed file with 17 additions and 29 deletions.
46 changes: 17 additions & 29 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,18 +1867,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
//#endregion

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

const DraggableView = enableContentPanningGesture
? BottomSheetDraggableView
: Animated.View;
Expand Down

0 comments on commit 9757bd2

Please sign in to comment.