@dhis2-ui/portal 10.16.3 → 10.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/portal.js +5 -6
- package/build/es/portal.js +5 -6
- package/package.json +1 -1
package/build/cjs/portal.js
CHANGED
|
@@ -20,12 +20,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
20
20
|
* This needs to be a function so that it works in tests as well.
|
|
21
21
|
*/
|
|
22
22
|
const getDefaultNode = () => document.getElementById('dhis2-portal-root') || document.body;
|
|
23
|
-
const Portal =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref;
|
|
23
|
+
const Portal = ({
|
|
24
|
+
children,
|
|
25
|
+
node,
|
|
26
|
+
disable
|
|
27
|
+
}) => {
|
|
29
28
|
const [mountNode, setMountNode] = (0, _react.useState)(null);
|
|
30
29
|
(0, _react.useEffect)(() => {
|
|
31
30
|
setMountNode(node || getDefaultNode());
|
package/build/es/portal.js
CHANGED
|
@@ -14,12 +14,11 @@ import { createPortal } from 'react-dom';
|
|
|
14
14
|
* This needs to be a function so that it works in tests as well.
|
|
15
15
|
*/
|
|
16
16
|
const getDefaultNode = () => document.getElementById('dhis2-portal-root') || document.body;
|
|
17
|
-
export const Portal =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
17
|
+
export const Portal = ({
|
|
18
|
+
children,
|
|
19
|
+
node,
|
|
20
|
+
disable
|
|
21
|
+
}) => {
|
|
23
22
|
const [mountNode, setMountNode] = useState(null);
|
|
24
23
|
useEffect(() => {
|
|
25
24
|
setMountNode(node || getDefaultNode());
|