@dhis2-ui/portal
Advanced tools
Comparing version 8.14.9 to 8.15.0-alpha.1
@@ -24,6 +24,4 @@ "use strict"; | ||
* As a fallback, portals will be attached to the document body. | ||
* | ||
* This needs to be a function so that it works in tests as well. | ||
*/ | ||
const getDefaultNode = () => document.getElementById('dhis2-portal-root') || document.body; | ||
const defaultNode = document.getElementById('dhis2-portal-root') || document.body; | ||
@@ -38,3 +36,3 @@ const Portal = _ref => { | ||
(0, _react.useEffect)(() => { | ||
setMountNode(node || getDefaultNode()); | ||
setMountNode(node || defaultNode); | ||
}, [node]); | ||
@@ -41,0 +39,0 @@ |
@@ -12,8 +12,5 @@ import PropTypes from 'prop-types'; | ||
* As a fallback, portals will be attached to the document body. | ||
* | ||
* This needs to be a function so that it works in tests as well. | ||
*/ | ||
const getDefaultNode = () => document.getElementById('dhis2-portal-root') || document.body; | ||
const defaultNode = document.getElementById('dhis2-portal-root') || document.body; | ||
export const Portal = _ref => { | ||
@@ -27,3 +24,3 @@ let { | ||
useEffect(() => { | ||
setMountNode(node || getDefaultNode()); | ||
setMountNode(node || defaultNode); | ||
}, [node]); | ||
@@ -30,0 +27,0 @@ |
{ | ||
"name": "@dhis2-ui/portal", | ||
"version": "8.14.9", | ||
"version": "8.15.0-alpha.1", | ||
"description": "UI Portal", | ||
@@ -38,3 +38,4 @@ "repository": { | ||
"files": [ | ||
"build" | ||
"build", | ||
"types" | ||
], | ||
@@ -45,3 +46,4 @@ "devDependencies": { | ||
"styled-jsx": "^4.0.1" | ||
} | ||
}, | ||
"types": "types" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4004
7
88
1