New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-element-resize

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-element-resize

Element resize sensor with optional debounce

latest
Source
npmnpm
Version
0.2.3
Version published
Weekly downloads
722
14.06%
Maintainers
1
Weekly downloads
 
Created
Source

react-element-resize npm

Element resize sensor with optional debounce

Gitter Dependencies Dev Dependencies

Installation

NPM

npm install --save react react-element-resize

Don't forget to manually install peer dependencies (react) if you use npm@3.

1998 Script Tag:

<script src="https://unpkg.com/react/dist/react.min.js"></script>
<script src="https://unpkg.com/react-element-resize/build/react-element-resize.min.js"></script>
(Module exposed as `ReactElementResize`)

Demo

http://nkbt.github.io/react-element-resize

Codepen demo

https://codepen.io/nkbt/pen/RVYWQm

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import {ReactElementResize} from 'react-element-resize';


const onResize = ({width, height}) =>
  console.log({width, height});


const onScroll = ({offsetLeft, offsetTop, scrollLeft, scrollTop}) =>
  console.log({offsetLeft, offsetTop, scrollLeft, scrollTop});


const App = () => (
  <ReactElementResize debounceTimeout={200} onResize={onResize} onScroll={onScroll}>
    {data => <pre>{JSON.stringify(data, null, 2)}</pre>}
  </ReactElementResize>
);

const appRoot = document.createElement('div');
document.body.appendChild(appRoot);
ReactDOM.render(<App />, appRoot);

Options

// TODO

License

MIT

Keywords

component

FAQs

Package last updated on 24 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts