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