mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-09 03:03:02 +00:00
merge new into master
This commit is contained in:
23
node_modules/@radix-ui/react-portal/dist/index.mjs
generated
vendored
Normal file
23
node_modules/@radix-ui/react-portal/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use client";
|
||||
|
||||
// src/portal.tsx
|
||||
import * as React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { Primitive } from "@radix-ui/react-primitive";
|
||||
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
||||
import { jsx } from "react/jsx-runtime";
|
||||
var PORTAL_NAME = "Portal";
|
||||
var Portal = React.forwardRef((props, forwardedRef) => {
|
||||
const { container: containerProp, ...portalProps } = props;
|
||||
const [mounted, setMounted] = React.useState(false);
|
||||
useLayoutEffect(() => setMounted(true), []);
|
||||
const container = containerProp || mounted && globalThis?.document?.body;
|
||||
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
||||
});
|
||||
Portal.displayName = PORTAL_NAME;
|
||||
var Root = Portal;
|
||||
export {
|
||||
Portal,
|
||||
Root
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
Reference in New Issue
Block a user