@remirror/react-portals
Advanced tools
Comparing version 0.6.3 to 0.6.4-ci.1573124774.1
@@ -13,6 +13,5 @@ 'use strict'; | ||
var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray')); | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var core = require('@emotion/core'); | ||
var react = require('react'); | ||
var reactDom = require('react-dom'); | ||
var core = require('@emotion/core'); | ||
@@ -113,3 +112,3 @@ /** | ||
var _useState = React.useState(Array.from(portalContainer.portals.entries())), | ||
var _useState = react.useState(Array.from(portalContainer.portals.entries())), | ||
_useState2 = _slicedToArray(_useState, 2), | ||
@@ -123,10 +122,10 @@ state = _useState2[0], | ||
var onPortalChange = React.useCallback(function (portalMap) { | ||
var onPortalChange = react.useCallback(function (portalMap) { | ||
setState(Array.from(portalMap.entries())); | ||
}, []); | ||
React.useEffect(function () { | ||
react.useEffect(function () { | ||
// Auto disposed when the component un-mounts | ||
return portalContainer.on(onPortalChange); | ||
}, [onPortalChange, portalContainer]); | ||
return core.jsx(React__default.Fragment, null, state.map(function (_ref2) { | ||
return core.jsx(react.Fragment, null, state.map(function (_ref2) { | ||
var _ref3 = _slicedToArray(_ref2, 2), | ||
@@ -138,3 +137,3 @@ container = _ref3[0], | ||
return core.jsx(React.Fragment, { | ||
return core.jsx(react.Fragment, { | ||
key: key | ||
@@ -158,3 +157,3 @@ }, reactDom.createPortal(core.jsx(Portal, { | ||
Component = _ref4.Component; | ||
React.useEffect(function () { | ||
react.useEffect(function () { | ||
/** | ||
@@ -161,0 +160,0 @@ * Remove the portal container entry when this portal is unmounted. |
@@ -7,5 +7,5 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck'; | ||
import _slicedToArray from '@babel/runtime/helpers/slicedToArray'; | ||
import React, { useState, useCallback, useEffect, Fragment } from 'react'; | ||
import { jsx } from '@emotion/core'; | ||
import { useState, useCallback, useEffect, Fragment } from 'react'; | ||
import { createPortal } from 'react-dom'; | ||
import { jsx } from '@emotion/core'; | ||
@@ -122,3 +122,3 @@ /** | ||
}, [onPortalChange, portalContainer]); | ||
return jsx(React.Fragment, null, state.map(function (_ref2) { | ||
return jsx(Fragment, null, state.map(function (_ref2) { | ||
var _ref3 = _slicedToArray(_ref2, 2), | ||
@@ -125,0 +125,0 @@ container = _ref3[0], |
@@ -0,1 +1,2 @@ | ||
/** @jsx jsx */ | ||
import { ReactElement } from 'react'; | ||
@@ -2,0 +3,0 @@ import { PortalContainer } from './portal-container'; |
@@ -6,6 +6,5 @@ 'use strict'; | ||
var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray')); | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var core = require('@emotion/core'); | ||
var react = require('react'); | ||
var reactDom = require('react-dom'); | ||
var core = require('@emotion/core'); | ||
@@ -21,3 +20,3 @@ /** | ||
var _useState = React.useState(Array.from(portalContainer.portals.entries())), | ||
var _useState = react.useState(Array.from(portalContainer.portals.entries())), | ||
_useState2 = _slicedToArray(_useState, 2), | ||
@@ -31,10 +30,10 @@ state = _useState2[0], | ||
var onPortalChange = React.useCallback(function (portalMap) { | ||
var onPortalChange = react.useCallback(function (portalMap) { | ||
setState(Array.from(portalMap.entries())); | ||
}, []); | ||
React.useEffect(function () { | ||
react.useEffect(function () { | ||
// Auto disposed when the component un-mounts | ||
return portalContainer.on(onPortalChange); | ||
}, [onPortalChange, portalContainer]); | ||
return core.jsx(React__default.Fragment, null, state.map(function (_ref2) { | ||
return core.jsx(react.Fragment, null, state.map(function (_ref2) { | ||
var _ref3 = _slicedToArray(_ref2, 2), | ||
@@ -46,3 +45,3 @@ container = _ref3[0], | ||
return core.jsx(React.Fragment, { | ||
return core.jsx(react.Fragment, { | ||
key: key | ||
@@ -66,3 +65,3 @@ }, reactDom.createPortal(core.jsx(Portal, { | ||
Component = _ref4.Component; | ||
React.useEffect(function () { | ||
react.useEffect(function () { | ||
/** | ||
@@ -69,0 +68,0 @@ * Remove the portal container entry when this portal is unmounted. |
@@ -8,3 +8,3 @@ { | ||
"repository": "https://github.com/ifiokjr/remirror/tree/canary/@remirror/react-portals", | ||
"version": "0.6.3", | ||
"version": "0.6.4-ci.1573124774.1+0ebb5233", | ||
"main": "lib/index.js", | ||
@@ -45,3 +45,3 @@ "module": "lib/dist/react-portals.esm.js", | ||
"sideEffects": false, | ||
"gitHead": "2ce54971bc170ead0310640cbe95630a21a04160" | ||
"gitHead": "0ebb52333284f08a679816394d9b5ce1359da48a" | ||
} |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
51212
24
752
2