@reach/portal
Advanced tools
Comparing version 0.11.2 to 0.12.0
@@ -13,3 +13,3 @@ /** | ||
*/ | ||
import React from "react"; | ||
import * as React from "react"; | ||
/** | ||
@@ -24,3 +24,3 @@ * Portal | ||
*/ | ||
export declare type PortalProps = { | ||
declare type PortalProps = { | ||
/** | ||
@@ -40,1 +40,3 @@ * Regular React children. | ||
export default Portal; | ||
export type { PortalProps }; | ||
export { Portal }; |
@@ -9,6 +9,2 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var React__default = /*#__PURE__*/_interopDefaultLegacy(React); | ||
/** | ||
@@ -54,3 +50,3 @@ * Welcome to @reach/portal! | ||
}, [type, forceUpdate]); | ||
return portalNode.current ? reactDom.createPortal(children, portalNode.current) : React__default['default'].createElement("span", { | ||
return portalNode.current ? reactDom.createPortal(children, portalNode.current) : React.createElement("span", { | ||
ref: mountNode | ||
@@ -62,5 +58,6 @@ }); | ||
Portal.displayName = "Portal"; | ||
} | ||
} //////////////////////////////////////////////////////////////////////////////// | ||
exports.Portal = Portal; | ||
exports.default = Portal; | ||
//# sourceMappingURL=portal.cjs.development.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@reach/utils"),t=require("react-dom");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=u(e);exports.default=function(u){var c=u.children,o=u.type,a=void 0===o?"reach-portal":o,l=e.useRef(null),i=e.useRef(null),d=r.useForceUpdate();return r.useIsomorphicLayoutEffect((function(){if(l.current){var e=l.current.ownerDocument;return i.current=null==e?void 0:e.createElement(a),e.body.appendChild(i.current),d(),function(){i.current&&i.current.ownerDocument&&i.current.ownerDocument.body.removeChild(i.current)}}}),[a,d]),i.current?t.createPortal(c,i.current):n.default.createElement("span",{ref:l})}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@reach/utils"),t=require("react-dom"),u=function(u){var n=u.children,c=u.type,o=void 0===c?"reach-portal":c,a=e.useRef(null),l=e.useRef(null),i=r.useForceUpdate();return r.useIsomorphicLayoutEffect((function(){if(a.current){var e=a.current.ownerDocument;return l.current=null==e?void 0:e.createElement(o),e.body.appendChild(l.current),i(),function(){l.current&&l.current.ownerDocument&&l.current.ownerDocument.body.removeChild(l.current)}}}),[o,i]),l.current?t.createPortal(n,l.current):e.createElement("span",{ref:a})};exports.Portal=u,exports.default=u; | ||
//# sourceMappingURL=portal.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
import React, { useRef } from 'react'; | ||
import { useRef, createElement } from 'react'; | ||
import { useForceUpdate, useIsomorphicLayoutEffect } from '@reach/utils'; | ||
@@ -45,3 +45,3 @@ import { createPortal } from 'react-dom'; | ||
}, [type, forceUpdate]); | ||
return portalNode.current ? createPortal(children, portalNode.current) : React.createElement("span", { | ||
return portalNode.current ? createPortal(children, portalNode.current) : createElement("span", { | ||
ref: mountNode | ||
@@ -53,5 +53,6 @@ }); | ||
Portal.displayName = "Portal"; | ||
} | ||
} //////////////////////////////////////////////////////////////////////////////// | ||
export default Portal; | ||
export { Portal }; | ||
//# sourceMappingURL=portal.esm.js.map |
{ | ||
"name": "@reach/portal", | ||
"version": "0.11.2", | ||
"version": "0.12.0", | ||
"description": "Declarative portals for React", | ||
@@ -27,6 +27,6 @@ "author": "React Training <hello@reacttraining.com>", | ||
"dependencies": { | ||
"@reach/utils": "0.11.2", | ||
"@reach/utils": "0.12.0", | ||
"tslib": "^2.0.0" | ||
}, | ||
"gitHead": "2aa6f03c5eed8c2b7525a29db1c69fe6bc540e5d" | ||
"gitHead": "09eeccda6e4597d21545982c53db5c42beddce6b" | ||
} |
Sorry, the diff of this file is not supported yet
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
19631
152
+ Added@reach/utils@0.12.0(transitive)
- Removed@reach/utils@0.11.2(transitive)
Updated@reach/utils@0.12.0