@crossed/primitive
Version:
A universal & performant styling library for React Native, Next.js & React
15 lines (14 loc) • 626 B
JavaScript
import { jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import { Provider, useContext } from "./context";
import { RemoveScroll as RS } from "../utils";
const createSheetPortal = (Styled) => forwardRef(({ ...props }, ref) => {
const { children, ...otherProps } = props;
const context = useContext();
const { open } = context;
return open ? /* @__PURE__ */ jsx(Styled, { ...otherProps, ref, children: /* @__PURE__ */ jsx(Provider, { ...context, children: /* @__PURE__ */ jsx(RS, { enabled: open, children }) }) }) : null;
});
export {
createSheetPortal
};
//# sourceMappingURL=SheetPortal.js.map