ZeeCoder / use-resize-observer

A React hook that allows you to use a ResizeObserver to measure an element's size.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Removing width in declaration if don't needed

Piero87 opened this issue · comments

Hi, in this line:

const [ref, width, height] = useResizeObserver();

How can I remove the width?

You can't with the current array return.

Could change the interface in the next major to:

const {ref, width, height} = useResizeObserver();

Especially, as if #16 is implemented, as you wouldn't want the ref in that case either.