react-portal
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -129,3 +129,3 @@ 'use strict'; | ||
var resetPortalState = function resetPortalState() { | ||
var resetPortalState = function resetPortalState(overrideIsUnmounted) { | ||
if (_this2.node) { | ||
@@ -137,3 +137,6 @@ _reactDom2.default.unmountComponentAtNode(_this2.node); | ||
_this2.node = null; | ||
if (isUnmounted !== true) { | ||
var finalIsUnmounted = overrideIsUnmounted === undefined ? isUnmounted : overrideIsUnmounted; | ||
if (finalIsUnmounted !== true) { | ||
_this2.setState({ active: false }); | ||
@@ -140,0 +143,0 @@ } |
@@ -85,3 +85,3 @@ import React from 'react'; | ||
closePortal(isUnmounted = false) { | ||
const resetPortalState = () => { | ||
const resetPortalState = (overrideIsUnmounted) => { | ||
if (this.node) { | ||
@@ -93,3 +93,8 @@ ReactDOM.unmountComponentAtNode(this.node); | ||
this.node = null; | ||
if (isUnmounted !== true) { | ||
const finalIsUnmounted = overrideIsUnmounted === undefined | ||
? isUnmounted | ||
: overrideIsUnmounted; | ||
if (finalIsUnmounted !== true) { | ||
this.setState({ active: false }); | ||
@@ -96,0 +101,0 @@ } |
{ | ||
"name": "react-portal", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "React component for transportation of modals, lightboxes, loading bars... to document.body", | ||
@@ -5,0 +5,0 @@ "main": "build/portal", |
@@ -105,4 +105,6 @@ React-portal | ||
#### beforeClose: func(DOMNode, removeFromDOM) | ||
This callback is called when the closing event is triggered but it prevents normal removal from the DOM. So, you can do some DOMNode animation first and then call removeFromDOM() that removes the portal from DOM. | ||
This callback is called when the closing event is triggered but it prevents normal removal from the DOM. So, you can do some DOMNode animation first and then call `removeFromDOM()` that removes the portal from DOM. | ||
If you'd like to execute some async logic in beforeClose, you should pass `isUnmounted:boolean` to `removeFromDom(isUnmounted)`. | ||
#### onClose: func | ||
@@ -109,0 +111,0 @@ This callback is called when the portal closes and after beforeClose. |
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
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
179
21034
5
333
1