Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@launchpad-ui/portal

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@launchpad-ui/portal - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

LICENSE

26

dist/index.es.js

@@ -0,19 +1,13 @@

import { jsx } from "react/jsx-runtime";
import { forwardRef, useState, useEffect } from "react";
import { createPortal } from "react-dom";
import { jsx } from "react/jsx-runtime";
const Portal = forwardRef(({
container = ((_a) => (_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body)(),
"data-test-id": testId = "portal",
...props
}, ref) => {
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
return mounted && container ? createPortal(/* @__PURE__ */ jsx("div", {
...props,
ref,
"data-test-id": testId
}), container) : null;
});
const Portal = forwardRef(
({ container = ((_a) => (_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body)(), "data-test-id": testId = "portal", ...props }, ref) => {
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
return mounted && container ? createPortal(/* @__PURE__ */ jsx("div", { ...props, ref, "data-test-id": testId }), container) : null;
}
);
Portal.displayName = "Portal";

@@ -20,0 +14,0 @@ export {

"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const react = require("react");
const reactDom = require("react-dom");
const jsxRuntime = require("react/jsx-runtime");
const Portal = react.forwardRef(({
container = ((_a) => (_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body)(),
"data-test-id": testId = "portal",
...props
}, ref) => {
const [mounted, setMounted] = react.useState(false);
react.useEffect(() => {
setMounted(true);
}, []);
return mounted && container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx("div", {
...props,
ref,
"data-test-id": testId
}), container) : null;
});
const Portal = react.forwardRef(
({ container = ((_a) => (_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body)(), "data-test-id": testId = "portal", ...props }, ref) => {
const [mounted, setMounted] = react.useState(false);
react.useEffect(() => {
setMounted(true);
}, []);
return mounted && container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ref, "data-test-id": testId }), container) : null;
}
);
Portal.displayName = "Portal";
exports.Portal = Portal;
//# sourceMappingURL=index.js.map
import type { HTMLAttributes } from 'react';
declare type PortalProps = HTMLAttributes<HTMLDivElement> & {
type PortalProps = HTMLAttributes<HTMLDivElement> & {
container?: HTMLElement | null;

@@ -4,0 +4,0 @@ 'data-test-id'?: string;

{
"name": "@launchpad-ui/portal",
"version": "0.1.0",
"version": "0.1.1",
"status": "alpha",

@@ -5,0 +5,0 @@ "publishConfig": {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc