@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
18 lines (17 loc) • 717 B
JavaScript
"use client";
import { useMantineEnv } from "../../core/MantineProvider/Mantine.context.mjs";
import { factory } from "../../core/factory/factory.mjs";
import { Portal } from "./Portal.mjs";
import { Fragment, jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Portal/OptionalPortal.tsx
const OptionalPortal = factory(({ withinPortal = true, children, ...others }) => {
if (useMantineEnv() === "test" || !withinPortal) return /* @__PURE__ */ jsx(Fragment, { children });
return /* @__PURE__ */ jsx(Portal, {
...others,
children
});
});
OptionalPortal.displayName = "@mantine/core/OptionalPortal";
//#endregion
export { OptionalPortal };
//# sourceMappingURL=OptionalPortal.mjs.map