UNPKG

@gorhom/bottom-sheet

Version:

A performant interactive bottom sheet with fully configurable options 🚀

30 lines (26 loc) • 668 B
import { useCallback } from 'react'; import { useBottomSheetInternal } from '../../hooks'; /** * A hook to set the content size properly into the bottom sheet, * internals. */ export function useBottomSheetContentSizeSetter() { //#region hooks const { enableDynamicSizing, animatedContentHeight } = useBottomSheetInternal(); //#endregion //#region methods const setContentSize = useCallback( (contentHeight: number) => { if (!enableDynamicSizing) { return; } animatedContentHeight.value = contentHeight; }, [enableDynamicSizing, animatedContentHeight] ); //#endregion return { setContentSize, }; }