@gorhom/bottom-sheet
Version:
A performant interactive bottom sheet with fully configurable options 🚀
26 lines (25 loc) • 1.11 kB
TypeScript
/**
* Provides dynamic content height calculating functionalities, by
* replacing the placeholder `CONTENT_HEIGHT` with calculated layout.
* @example
* [0, 'CONTENT_HEIGHT', '100%']
* @param initialSnapPoints your snap point with content height placeholder.
* @returns {
* - animatedSnapPoints: an animated snap points to be set on `BottomSheet` or `BottomSheetModal`.
* - animatedHandleHeight: an animated handle height callback node to be set on `BottomSheet` or `BottomSheetModal`.
* - animatedContentHeight: an animated content height callback node to be set on `BottomSheet` or `BottomSheetModal`.
* - handleContentLayout: a `onLayout` callback method to be set on `BottomSheetView` component.
* }
*/
export declare const useBottomSheetDynamicSnapPoints: (initialSnapPoints: Array<string | number>) => {
animatedSnapPoints: Readonly<{
value: (string | number)[];
}>;
animatedHandleHeight: {
value: number;
};
animatedContentHeight: {
value: number;
};
handleContentLayout: ({ nativeEvent: { layout: { height }, }, }: any) => void;
};