use-size-ref

v0.0.1
useSizeRef
umi hooks react hooks

useSizeRef

A react-hook that notify the size change of dom element

Install

npm i use-size-ref --save

Usage

import { useSizeRef } from 'use-size-ref';

const [ref, { width, height }] = useSizeRef();

console.log(width, height);
return (<div ref={ref} />)

LICENSE

MIT

npm i use-size-ref

Metadata

  • MIT
  • >=8.0.0
  • Unknown
  • released 9/25/2019

Downloads

Maintainers