UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

30 lines (29 loc) 770 B
import { jsx } from "react/jsx-runtime"; import { forwardRef, useCallback } from "react"; import { Pressable } from "react-native"; import { useSheetContext } from "./context"; import { composeEventHandlers } from "@crossed/core"; import { Slot } from "../../Slot"; const Trigger = forwardRef( (props, ref) => { const { actionSheetRef } = useSheetContext(); const onPress = useCallback(() => { var _a; (_a = actionSheetRef.current) == null ? void 0 : _a.show(); }, []); return /* @__PURE__ */ jsx( Slot, { Comp: Pressable, ref, role: "button", ...props, onPress: composeEventHandlers(props.onPress, onPress) } ); } ); export { Trigger }; //# sourceMappingURL=Trigger.js.map