You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@reach/portal

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.1.0

11

es/index.js

@@ -11,8 +11,11 @@ import React from "react";

getRefs: function getRefs() {
return { node: document.createElement(type) };
return { node: null };
},
didMount: function didMount(_ref2) {
var node = _ref2.refs.node;
var refs = _ref2.refs,
forceUpdate = _ref2.forceUpdate;
document.body.appendChild(node);
refs.node = document.createElement(type);
document.body.appendChild(refs.node);
forceUpdate();
},

@@ -27,3 +30,3 @@ willUnmount: function willUnmount(_ref3) {

return createPortal(children, node);
return node ? createPortal(children, node) : null;
}

@@ -30,0 +33,0 @@ });

@@ -23,8 +23,11 @@ "use strict";

getRefs: function getRefs() {
return { node: document.createElement(type) };
return { node: null };
},
didMount: function didMount(_ref2) {
var node = _ref2.refs.node;
var refs = _ref2.refs,
forceUpdate = _ref2.forceUpdate;
document.body.appendChild(node);
refs.node = document.createElement(type);
document.body.appendChild(refs.node);
forceUpdate();
},

@@ -39,3 +42,3 @@ willUnmount: function willUnmount(_ref3) {

return (0, _reactDom.createPortal)(children, node);
return node ? (0, _reactDom.createPortal)(children, node) : null;
}

@@ -42,0 +45,0 @@ });

{
"name": "@reach/portal",
"version": "0.0.2",
"version": "0.1.0",
"description": "Declarative portals for React",
"main": "index.js",
"module": "es/index.js",
"scripts": {

@@ -11,7 +12,7 @@ "test": "echo \"Write some tests you bum!\"",

"dependencies": {
"@reach/component-component": "^0.0.2"
"@reach/component-component": "^0.1.0"
},
"peerDependencies": {
"react": "15.x || 16.x",
"react-dom": "15.x || 16.x"
"react": "^16.4.0",
"react-dom": "^16.4.0"
},

@@ -18,0 +19,0 @@ "author": "",

@@ -7,5 +7,7 @@ import React from "react";

<Component
getRefs={() => ({ node: document.createElement(type) })}
didMount={({ refs: { node } }) => {
document.body.appendChild(node);
getRefs={() => ({ node: null })}
didMount={({ refs, forceUpdate }) => {
refs.node = document.createElement(type);
document.body.appendChild(refs.node);
forceUpdate();
}}

@@ -16,3 +18,3 @@ willUnmount={({ refs: { node } }) => {

render={({ refs: { node } }) => {
return createPortal(children, node);
return node ? createPortal(children, node) : null;
}}

@@ -19,0 +21,0 @@ />

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc