diff --git a/src/BottomSheet.tsx b/src/BottomSheet.tsx index f5164fe9..400dfe6f 100644 --- a/src/BottomSheet.tsx +++ b/src/BottomSheet.tsx @@ -142,17 +142,17 @@ export const BottomSheet = React.forwardRef< maxHeightRef, maxSnapRef, minSnapRef, - updateSnap, observeBoundsRef, + updateSnap, } = useSnapResponder({ draggingRef, - maxHeight, - minSnap, - prefersReducedMotion, - maxSnap, findSnap, heightRef, lastSnapRef, + maxHeight, + maxSnap, + minSnap, + prefersReducedMotion, set, }) useImperativeHandle( @@ -485,6 +485,13 @@ export const BottomSheet = React.forwardRef< axis: 'y', }) + if (Number.isNaN(maxSnapRef.current)) { + throw new TypeError('maxSnapRef is NaN!!') + } + if (Number.isNaN(minSnapRef.current)) { + throw new TypeError('minSnapRef is NaN!!') + } + // @TODO the ts-ignore comments are because the `extrapolate` param isn't in the TS defs for some reason const interpolateBorderRadius = maxHeightRef.current !== maxSnapRef.current