Socket
Socket
Sign inDemoInstall

react-portal

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-portal - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

7

build/portal.js

@@ -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.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc