Socket
Socket
Sign inDemoInstall

@radix-ui/react-use-size

Package Overview
Dependencies
Maintainers
5
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.0.3 to 0.0.4

2

dist/index.js

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

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

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

import{useState as e,useEffect as r}from"react";var t,i,n;function o(t){const[i,n]=e(void 0);return r((()=>{if(t.current){const e=t.current,r=new ResizeObserver((r=>{if(!Array.isArray(r))return;if(!r.length)return;const t=r[0];let i,o;if("borderBoxSize"in t){const e=t.borderBoxSize,r=Array.isArray(e)?e[0]:e;i=r.inlineSize,o=r.blockSize}else{const r=e.getBoundingClientRect();i=r.width,o=r.height}n({width:i,height:o})}));return r.observe(e,{box:"border-box"}),()=>{n(void 0),r.unobserve(e)}}}),[t]),i}export{o as useSize};t={},i="useSize",n=function(){return o},Object.defineProperty(t,i,{get:n,enumerable:!0});
import*as e from"react";export function useSize(r){const[t,i]=e.useState(void 0);return e.useEffect((()=>{if(r.current){const e=r.current,t=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 t.observe(e,{box:"border-box"}),()=>{i(void 0),t.unobserve(e)}}}),[r]),t}
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-use-size",
"version": "0.0.3",
"version": "0.0.4",
"license": "MIT",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

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