Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rc-component/trigger

Package Overview
Dependencies
Maintainers
4
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rc-component/trigger - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

18

es/mock.js

@@ -0,11 +1,25 @@

import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import * as React from 'react';
import { generateTrigger } from "./index";
var MockPortal = function MockPortal(_ref) {
var children = _ref.children,
var open = _ref.open,
autoDestroy = _ref.autoDestroy,
children = _ref.children,
getContainer = _ref.getContainer;
var _React$useState = React.useState(open),
_React$useState2 = _slicedToArray(_React$useState, 2),
visible = _React$useState2[0],
setVisible = _React$useState2[1];
React.useEffect(function () {
getContainer === null || getContainer === void 0 ? void 0 : getContainer();
});
return children;
React.useEffect(function () {
if (open) {
setVisible(true);
} else if (!open && autoDestroy) {
setVisible(false);
}
}, [open, autoDestroy]);
return visible ? children : null;
};
export default generateTrigger(MockPortal);
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {

@@ -8,13 +9,27 @@ value: true

exports.default = void 0;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var React = _interopRequireWildcard(require("react"));
var _index = require("./index");
var MockPortal = function MockPortal(_ref) {
var children = _ref.children,
var open = _ref.open,
autoDestroy = _ref.autoDestroy,
children = _ref.children,
getContainer = _ref.getContainer;
var _React$useState = React.useState(open),
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
visible = _React$useState2[0],
setVisible = _React$useState2[1];
React.useEffect(function () {
getContainer === null || getContainer === void 0 ? void 0 : getContainer();
});
return children;
React.useEffect(function () {
if (open) {
setVisible(true);
} else if (!open && autoDestroy) {
setVisible(false);
}
}, [open, autoDestroy]);
return visible ? children : null;
};
var _default = (0, _index.generateTrigger)(MockPortal);
exports.default = _default;

2

package.json
{
"name": "@rc-component/trigger",
"version": "1.0.3",
"version": "1.0.4",
"description": "base abstract trigger component for react",

@@ -5,0 +5,0 @@ "engines": {

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