Socket
Socket
Sign inDemoInstall

@radix-ui/react-use-size

Package Overview
Dependencies
Maintainers
7
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-use-size - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1-rc.1

2

dist/index.js

@@ -1,2 +0,2 @@

var e,r,t=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e);exports.useSize=function(e){const[r,i]=t.useState(void 0);return t.useEffect((()=>{if(e){const r=new ResizeObserver((r=>{if(!Array.isArray(r))return;if(!r.length)return;const t=r[0];let n,o;if("borderBoxSize"in t){const e=t.borderBoxSize,r=Array.isArray(e)?e[0]:e;n=r.inlineSize,o=r.blockSize}else{const r=e.getBoundingClientRect();n=r.width,o=r.height}i({width:n,height:o})}));return r.observe(e,{box:"border-box"}),()=>{i(void 0),r.unobserve(e)}}}),[e]),r};
var e,r,t=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e);exports.useSize=function(e){const[r,i]=t.useState(void 0);return t.useEffect((()=>{if(e){const r=new ResizeObserver((r=>{if(!Array.isArray(r))return;if(!r.length)return;const t=r[0];let n,o;if("borderBoxSize"in t){const e=t.borderBoxSize,r=Array.isArray(e)?e[0]:e;n=r.inlineSize,o=r.blockSize}else{const r=e.getBoundingClientRect();n=r.width,o=r.height}i({width:n,height:o})}));return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}i(void 0)}),[e]),r};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import*as e from"react";export function useSize(r){const[i,t]=e.useState(void 0);return e.useEffect((()=>{if(r){const e=new ResizeObserver((e=>{if(!Array.isArray(e))return;if(!e.length)return;const i=e[0];let o,n;if("borderBoxSize"in i){const e=i.borderBoxSize,r=Array.isArray(e)?e[0]:e;o=r.inlineSize,n=r.blockSize}else{const e=r.getBoundingClientRect();o=e.width,n=e.height}t({width:o,height:n})}));return e.observe(r,{box:"border-box"}),()=>{t(void 0),e.unobserve(r)}}}),[r]),i}
import*as e from"react";export function useSize(r){const[i,t]=e.useState(void 0);return e.useEffect((()=>{if(r){const e=new ResizeObserver((e=>{if(!Array.isArray(e))return;if(!e.length)return;const i=e[0];let o,n;if("borderBoxSize"in i){const e=i.borderBoxSize,r=Array.isArray(e)?e[0]:e;o=r.inlineSize,n=r.blockSize}else{const e=r.getBoundingClientRect();o=e.width,n=e.height}t({width:o,height:n})}));return e.observe(r,{box:"border-box"}),()=>e.unobserve(r)}t(void 0)}),[r]),i}
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-use-size",
"version": "0.1.0",
"version": "0.1.1-rc.1",
"license": "MIT",

@@ -34,3 +34,4 @@ "source": "src/index.ts",

"@babel/runtime": "^7.13.10"
}
},
"stableVersion": "0.1.0"
}

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