Skip to content

Commit 752aef1

Browse files
committed
fix: allow initialHeight to be a number
1 parent 96b65b3 commit 752aef1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import type { GetInitialHeight, GetSnapPoints } from '@bottom-sheet/types'
1515

1616
export interface BottomSheetMachineProps {
17-
initialHeight?: GetInitialHeight
17+
initialHeight?: number | GetInitialHeight
1818
snapPoints?: GetSnapPoints
1919
}
2020

@@ -26,7 +26,11 @@ function createStore({
2626
const service = interpret(
2727
BottomSheetMachine.withConfig({
2828
actions: {
29-
setInitialHeight: assignInitialHeight(initialHeight),
29+
setInitialHeight: assignInitialHeight(
30+
typeof initialHeight === 'function'
31+
? initialHeight
32+
: () => initialHeight
33+
),
3034
setSnapPoints: assignSnapPoints(snapPoints),
3135
},
3236
})

0 commit comments

Comments
 (0)