Skip to content

Commit 9448253

Browse files
fix: provide default value for snapPoints
1 parent c638247 commit 9448253

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/BottomSheetView.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ function BottomSheetModalScreen({
7272
);
7373
}
7474

75+
const DEFAULT_SNAP_POINTS = ['66%'];
76+
7577
type Props = BottomSheetNavigationConfig & {
7678
state: BottomSheetNavigationState<ParamListBase>;
7779
navigation: BottomSheetNavigationHelpers;
@@ -107,7 +109,7 @@ export function BottomSheetView({ state, descriptors }: Props) {
107109
index,
108110
backgroundStyle,
109111
handleIndicatorStyle,
110-
snapPoints,
112+
snapPoints = DEFAULT_SNAP_POINTS,
111113
...sheetProps
112114
} = options;
113115

src/types.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export type BottomSheetNavigationOptions = Omit<
8888
* snapPoints={['%100']}
8989
* @type Array<string | number>
9090
*/
91-
snapPoints: Array<string | number>;
91+
snapPoints?: Array<string | number>;
9292
};
9393

9494
export type BottomSheetNavigatorProps = DefaultNavigatorOptions<

0 commit comments

Comments
 (0)