New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-stick

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-stick - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

14

lib/getBoundingClientRect.js

@@ -5,13 +5,19 @@ 'use strict';

var _react = require('react');
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _reactDom = require('react-dom');
var getBoundingClientRect = function getBoundingClientRect(instance) {
// $FlowIgnore: we only allow string type components, so we will always find an Element
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getBoundingClientRect(instance) {
var element = (0, _reactDom.findDOMNode)(instance);
(0, _invariant2.default)(element instanceof window.HTMLElement || element instanceof window.SVGElement, 'Cannot retrieve client rect of text or null elements');
return element.getBoundingClientRect();
};
}
exports.default = getBoundingClientRect;
module.exports = exports['default'];
{
"name": "react-stick",
"version": "2.2.2",
"version": "2.2.3",
"description": "React component to stick a portaled node to an anchor node",

@@ -28,2 +28,3 @@ "main": "lib/index.js",

"dependencies": {
"invariant": "^2.2.4",
"lodash": "^4.17.4",

@@ -30,0 +31,0 @@ "prop-types": "^15.6.0",

// @flow
import { Component } from 'react'
import invariant from 'invariant'
import { findDOMNode } from 'react-dom'
const getBoundingClientRect = (instance: Component<any, any>): ClientRect => {
// $FlowIgnore: we only allow string type components, so we will always find an Element
const element: Element = findDOMNode(instance)
function getBoundingClientRect(instance: *): ClientRect {
const element = findDOMNode(instance)
invariant(
element instanceof window.HTMLElement ||
element instanceof window.SVGElement,
'Cannot retrieve client rect of text or null elements'
)
return element.getBoundingClientRect()

@@ -9,0 +16,0 @@ }

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

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