MCPcopy
hub / github.com/obytes/react-native-template-obytes / useModal

Function useModal

src/components/ui/modal.tsx:55–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53};
54
55export function useModal() {
56 const ref = React.useRef<BottomSheetModal>(null);
57 const present = React.useCallback((data?: any) => {
58 ref.current?.present(data);
59 }, []);
60 const dismiss = React.useCallback(() => {
61 ref.current?.dismiss();
62 }, []);
63 return { ref, present, dismiss };
64}
65
66export function Modal({ ref, snapPoints: _snapPoints = ['60%'] as (string | number)[], title, detached = false, ...props }: ModalProps & { ref?: ModalRef }) {
67 const detachedProps = React.useMemo(

Callers 4

SelectFunction · 0.90
ThemeItemFunction · 0.90
LanguageItemFunction · 0.90
ModalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected