@radix-ui/react-portal
Advanced tools
Comparing version 1.1.0-rc.1 to 1.1.0-rc.2
@@ -10,3 +10,3 @@ import * as React from 'react'; | ||
*/ | ||
container?: HTMLElement | null; | ||
container?: Element | null; | ||
} | ||
@@ -13,0 +13,0 @@ declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>; |
"use strict"; | ||
"use client"; | ||
(() => { | ||
@@ -36,6 +37,10 @@ var __create = Object.create; | ||
var import_react_primitive = __require("@radix-ui/react-primitive"); | ||
var import_react_use_layout_effect = __require("@radix-ui/react-use-layout-effect"); | ||
var import_jsx_runtime = __require("react/jsx-runtime"); | ||
var PORTAL_NAME = "Portal"; | ||
var Portal = React.forwardRef((props, forwardedRef) => { | ||
const { container = globalThis?.document?.body, ...portalProps } = props; | ||
const { container: containerProp, ...portalProps } = props; | ||
const [mounted, setMounted] = React.useState(false); | ||
(0, import_react_use_layout_effect.useLayoutEffect)(() => setMounted(true), []); | ||
const container = containerProp || mounted && globalThis?.document?.body; | ||
return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null; | ||
@@ -42,0 +47,0 @@ }); |
{ | ||
"name": "@radix-ui/react-portal", | ||
"version": "1.1.0-rc.1", | ||
"version": "1.1.0-rc.2", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "exports": { | ||
"dependencies": { | ||
"@radix-ui/react-primitive": "1.1.0-rc.1" | ||
"@radix-ui/react-primitive": "1.1.0-rc.2" | ||
}, | ||
@@ -34,0 +34,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10438
84
+ Added@radix-ui/react-compose-refs@1.1.0-rc.2(transitive)
+ Added@radix-ui/react-primitive@1.1.0-rc.2(transitive)
+ Added@radix-ui/react-slot@1.1.0-rc.2(transitive)
- Removed@radix-ui/react-compose-refs@1.1.0-rc.1(transitive)
- Removed@radix-ui/react-primitive@1.1.0-rc.1(transitive)
- Removed@radix-ui/react-slot@1.1.0-rc.1(transitive)