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

@avinlab/react-size-me

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@avinlab/react-size-me - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

3

CHANGELOG.md

@@ -9,1 +9,4 @@ Changelog

Using `element-resize-detector` to catch container's resize events
# 1.1.1
Always render child even before size calculations to save refs

24

dist/index.cjs.js

@@ -27,4 +27,4 @@ 'use strict';

_this.state = {
width: _this.props.defaultHeight || null,
height: _this.props.defaultHeight || null
width: _this.props.defaultHeight || 0,
height: _this.props.defaultHeight || 0
};

@@ -72,16 +72,14 @@

if (typeof children === 'function') {
if (width !== null && height !== null) {
var params = {};
var params = {};
if (!disableHeight) {
params.height = height;
}
if (!disableHeight) {
params.height = height;
}
if (!disableWidth) {
params.width = width;
}
if (!disableWidth) {
params.width = width;
}
onResize(params);
return children(params);
}
onResize(params);
return children(params);
}

@@ -88,0 +86,0 @@ };

@@ -23,4 +23,4 @@ import _extends from '@babel/runtime/helpers/esm/extends';

_this.state = {
width: _this.props.defaultHeight || null,
height: _this.props.defaultHeight || null
width: _this.props.defaultHeight || 0,
height: _this.props.defaultHeight || 0
};

@@ -68,16 +68,14 @@

if (typeof children === 'function') {
if (width !== null && height !== null) {
var params = {};
var params = {};
if (!disableHeight) {
params.height = height;
}
if (!disableHeight) {
params.height = height;
}
if (!disableWidth) {
params.width = width;
}
if (!disableWidth) {
params.width = width;
}
onResize(params);
return children(params);
}
onResize(params);
return children(params);
}

@@ -84,0 +82,0 @@ };

{
"name": "@avinlab/react-size-me",
"version": "1.1.0",
"version": "1.1.1",
"description": "React components for determine parent container size",

@@ -39,3 +39,3 @@ "author": "Avin Grape <carcinogen75@gmail.com> (https://github.com/avin/)",

"build:source": "rollup -c",
"deploy": "rimraf demo && build:demo",
"deploy": "rimraf demo && npm run build:demo && gh-pages -d demo -r https://github.com/avin/react-size-me",
"flow": "flow check --max-warnings=0 src && flow check website",

@@ -42,0 +42,0 @@ "linc": "lint-staged",

# react-size-me
> React components for determine parent container size
> React component to determine parent container size
[![NPM registry](https://img.shields.io/npm/v/react-size-me.svg?style=for-the-badge)](https://yarnpkg.com/en/package/react-size-me) [![Travis](https://img.shields.io/badge/ci-travis-green.svg?style=for-the-badge)](https://travis-ci.org/bvaughn/react-size-me) [![NPM license](https://img.shields.io/badge/license-mit-red.svg?style=for-the-badge)](LICENSE)
[![NPM registry](https://img.shields.io/npm/v/@avinlab/react-size-me.svg?style=for-the-badge)](https://yarnpkg.com/en/package/@avinlab/react-size-me) [![NPM license](https://img.shields.io/badge/license-mit-red.svg?style=for-the-badge)](LICENSE)
## Demo
Here is an [examples page](https://avin.github.io/react-size-me)
## Install

@@ -8,0 +12,0 @@

@@ -49,4 +49,4 @@ //@flow

type State = {
height: ?number,
width: ?number,
height: number,
width: number,
};

@@ -67,4 +67,4 @@

state = {
width: this.props.defaultHeight || null,
height: this.props.defaultHeight || null,
width: this.props.defaultHeight || 0,
height: this.props.defaultHeight || 0,
};

@@ -106,15 +106,13 @@

if (typeof children === 'function') {
if (width !== null && height !== null) {
const params = {};
if (!disableHeight) {
params.height = height;
}
if (!disableWidth) {
params.width = width;
}
const params = {};
if (!disableHeight) {
params.height = height;
}
if (!disableWidth) {
params.width = width;
}
onResize(params);
onResize(params);
return children(params);
}
return children(params);
}

@@ -121,0 +119,0 @@ }

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