@uiw/react-portal
Advanced tools
Comparing version 5.0.0-bate-1 to 5.0.0-bate-10
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,10 +9,6 @@ value: true | ||
exports["default"] = Portal; | ||
var _react = require("react"); | ||
var _reactDom = _interopRequireDefault(require("react-dom")); | ||
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); | ||
exports.canUseDOM = canUseDOM; | ||
function Portal(props) { | ||
@@ -31,11 +26,8 @@ var container = props.container; | ||
}, []); | ||
if (!canUseDOM) { | ||
return null; | ||
} | ||
if (!containerRef.current) { | ||
containerRef.current = document.body; | ||
} | ||
if (!defaultNode.current) { | ||
@@ -45,5 +37,4 @@ defaultNode.current = document.createElement('div'); | ||
} | ||
return /*#__PURE__*/_reactDom["default"].createPortal(props.children, defaultNode.current); | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -18,11 +18,8 @@ import { useEffect, useRef } from 'react'; | ||
}, []); | ||
if (!canUseDOM) { | ||
return null; | ||
} | ||
if (!containerRef.current) { | ||
containerRef.current = document.body; | ||
} | ||
if (!defaultNode.current) { | ||
@@ -32,5 +29,4 @@ defaultNode.current = document.createElement('div'); | ||
} | ||
return /*#__PURE__*/ReactDOM.createPortal(props.children, defaultNode.current); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@uiw/react-portal", | ||
"version": "5.0.0-bate-1", | ||
"version": "5.0.0-bate-10", | ||
"description": "Portal component", | ||
@@ -5,0 +5,0 @@ "author": "Kenny Wong <wowohoo@qq.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12948