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

@alfalab/core-components-portal

Package Overview
Dependencies
Maintainers
18
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alfalab/core-components-portal - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

4

Component.d.ts

@@ -10,4 +10,8 @@ /// <reference types="react" />

getPortalContainer?: () => Element;
/**
* Немедленно отрендерить дочерние элементы (false - контент будет отрендерен на след. рендер).
*/
immediateMount?: boolean;
};
declare const Portal: import("react").ForwardRefExoticComponent<PortalProps & import("react").RefAttributes<Element>>;
export { PortalProps, Portal };

6

Component.js

@@ -10,4 +10,6 @@ 'use strict';

var Portal = react.forwardRef(function (_a, ref) {
var _b = _a.getPortalContainer, getPortalContainer = _b === void 0 ? utils.getDefaultPortalContainer : _b, children = _a.children;
var _c = react.useState(null), mountNode = _c[0], setMountNode = _c[1];
var _b = _a.getPortalContainer, getPortalContainer = _b === void 0 ? utils.getDefaultPortalContainer : _b, _c = _a.immediateMount, immediateMount = _c === void 0 ? false : _c, children = _a.children;
var _d = react.useState(function () {
return immediateMount ? getPortalContainer() : null;
}), mountNode = _d[0], setMountNode = _d[1];
react.useEffect(function () {

@@ -14,0 +16,0 @@ setMountNode(getPortalContainer());

@@ -10,4 +10,8 @@ /// <reference types="react" />

getPortalContainer?: () => Element;
/**
* Немедленно отрендерить дочерние элементы (false - контент будет отрендерен на след. рендер).
*/
immediateMount?: boolean;
};
declare const Portal: import("react").ForwardRefExoticComponent<PortalProps & import("react").RefAttributes<Element>>;
export { PortalProps, Portal };

@@ -10,4 +10,6 @@ 'use strict';

var Portal = react.forwardRef(function (_a, ref) {
var _b = _a.getPortalContainer, getPortalContainer = _b === void 0 ? utils.getDefaultPortalContainer : _b, children = _a.children;
var _c = react.useState(null), mountNode = _c[0], setMountNode = _c[1];
var _b = _a.getPortalContainer, getPortalContainer = _b === void 0 ? utils.getDefaultPortalContainer : _b, _c = _a.immediateMount, immediateMount = _c === void 0 ? false : _c, children = _a.children;
var _d = react.useState(function () {
return immediateMount ? getPortalContainer() : null;
}), mountNode = _d[0], setMountNode = _d[1];
react.useEffect(function () {

@@ -14,0 +16,0 @@ setMountNode(getPortalContainer());

@@ -10,4 +10,8 @@ /// <reference types="react" />

getPortalContainer?: () => Element;
/**
* Немедленно отрендерить дочерние элементы (false - контент будет отрендерен на след. рендер).
*/
immediateMount?: boolean;
};
declare const Portal: import("react").ForwardRefExoticComponent<PortalProps & import("react").RefAttributes<Element>>;
export { PortalProps, Portal };

@@ -6,4 +6,6 @@ import { forwardRef, useState, useEffect } from 'react';

var Portal = forwardRef(function (_a, ref) {
var _b = _a.getPortalContainer, getPortalContainer = _b === void 0 ? getDefaultPortalContainer : _b, children = _a.children;
var _c = useState(null), mountNode = _c[0], setMountNode = _c[1];
var _b = _a.getPortalContainer, getPortalContainer = _b === void 0 ? getDefaultPortalContainer : _b, _c = _a.immediateMount, immediateMount = _c === void 0 ? false : _c, children = _a.children;
var _d = useState(function () {
return immediateMount ? getPortalContainer() : null;
}), mountNode = _d[0], setMountNode = _d[1];
useEffect(function () {

@@ -10,0 +12,0 @@ setMountNode(getPortalContainer());

@@ -10,4 +10,8 @@ /// <reference types="react" />

getPortalContainer?: () => Element;
/**
* Немедленно отрендерить дочерние элементы (false - контент будет отрендерен на след. рендер).
*/
immediateMount?: boolean;
};
declare const Portal: import("react").ForwardRefExoticComponent<PortalProps & import("react").RefAttributes<Element>>;
export { PortalProps, Portal };

@@ -5,4 +5,4 @@ import { forwardRef, useState, useEffect } from 'react';

const Portal = forwardRef(({ getPortalContainer = getDefaultPortalContainer, children }, ref) => {
const [mountNode, setMountNode] = useState(null);
const Portal = forwardRef(({ getPortalContainer = getDefaultPortalContainer, immediateMount = false, children }, ref) => {
const [mountNode, setMountNode] = useState(() => immediateMount ? getPortalContainer() : null);
useEffect(() => {

@@ -9,0 +9,0 @@ setMountNode(getPortalContainer());

{
"name": "@alfalab/core-components-portal",
"version": "3.0.1",
"version": "3.1.0",
"description": "Portal component",

@@ -5,0 +5,0 @@ "keywords": [],

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