We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96b65b3 commit 752aef1Copy full SHA for 752aef1
src/index.ts
@@ -14,7 +14,7 @@ import {
14
import type { GetInitialHeight, GetSnapPoints } from '@bottom-sheet/types'
15
16
export interface BottomSheetMachineProps {
17
- initialHeight?: GetInitialHeight
+ initialHeight?: number | GetInitialHeight
18
snapPoints?: GetSnapPoints
19
}
20
@@ -26,7 +26,11 @@ function createStore({
26
const service = interpret(
27
BottomSheetMachine.withConfig({
28
actions: {
29
- setInitialHeight: assignInitialHeight(initialHeight),
+ setInitialHeight: assignInitialHeight(
30
+ typeof initialHeight === 'function'
31
+ ? initialHeight
32
+ : () => initialHeight
33
+ ),
34
setSnapPoints: assignSnapPoints(snapPoints),
35
},
36
})
0 commit comments