@alfalab/core-components-portal
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -12,3 +12,3 @@ 'use strict'; | ||
var _d = react.useState(function () { | ||
return immediateMount ? getPortalContainer() : null; | ||
return typeof window !== 'undefined' && immediateMount ? getPortalContainer() : null; | ||
}), mountNode = _d[0], setMountNode = _d[1]; | ||
@@ -15,0 +15,0 @@ react.useEffect(function () { |
@@ -12,3 +12,3 @@ 'use strict'; | ||
var _d = react.useState(function () { | ||
return immediateMount ? getPortalContainer() : null; | ||
return typeof window !== 'undefined' && immediateMount ? getPortalContainer() : null; | ||
}), mountNode = _d[0], setMountNode = _d[1]; | ||
@@ -15,0 +15,0 @@ react.useEffect(function () { |
@@ -8,3 +8,3 @@ import { forwardRef, useState, useEffect } from 'react'; | ||
var _d = useState(function () { | ||
return immediateMount ? getPortalContainer() : null; | ||
return typeof window !== 'undefined' && immediateMount ? getPortalContainer() : null; | ||
}), mountNode = _d[0], setMountNode = _d[1]; | ||
@@ -11,0 +11,0 @@ useEffect(function () { |
@@ -6,3 +6,3 @@ import { forwardRef, useState, useEffect } from 'react'; | ||
const Portal = forwardRef(({ getPortalContainer = getDefaultPortalContainer, immediateMount = false, children }, ref) => { | ||
const [mountNode, setMountNode] = useState(() => immediateMount ? getPortalContainer() : null); | ||
const [mountNode, setMountNode] = useState(() => typeof window !== 'undefined' && immediateMount ? getPortalContainer() : null); | ||
useEffect(() => { | ||
@@ -9,0 +9,0 @@ setMountNode(getPortalContainer()); |
{ | ||
"name": "@alfalab/core-components-portal", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Portal component", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -58,3 +58,3 @@ const http = require('http'); | ||
return new Promise((resolve, reject) => { | ||
const req = http.request(options, res => { | ||
const req = http.request(options, (res) => { | ||
res.on('end', () => { | ||
@@ -61,0 +61,0 @@ resolve(); |
Telemetry
Supply chain riskThis package contains telemetry which tracks how it is used.
Found 1 instance in 1 package
15212
1