ZeeCoder / use-resize-observer

A React hook that allows you to use a ResizeObserver to measure an element's size.
MIT License
644 stars 42 forks source link

Why is it suggested to instal as a dev dependency #89

Closed hepiyellow closed 2 years ago

hepiyellow commented 2 years ago

The README states:

yarn add use-resize-observer --dev
# or
npm install use-resize-observer --save-dev

Isn't it supposed to get built and run in the browser?

ZeeCoder commented 2 years ago

That is correct, that's how it's used. It's all based on your setup: I worked with a lot of setup that had a Node.js backend and a frontend within the same repo, so dependencies were node's, while dev deps were the frontend's.

There's nothing "clever" done here, you do you. :)

ZeeCoder commented 2 years ago

Also see the discussion here: https://github.com/ZeeCoder/use-resize-observer/discussions/87