streamich / react-use

React Hooks — 👍
http://streamich.github.io/react-use
The Unlicense
41.98k stars 3.16k forks source link

feat: add useScrollHeight hook #2592

Open Muhammad-21 opened 2 months ago

Muhammad-21 commented 2 months ago

Description

The useScrollHeight hook takes a RefObject as an argument and returns the current scroll height of the referenced HTML element.

The motivation behind creating this custom hook is likely to provide a way to dynamically track the scroll height of an HTML element, which can be useful in various scenarios such as:

The context in which this hook might be used is likely in a React application where the scroll height of an element needs to be tracked and updated in real-time (For example, in chats, where you will always need to show the last message)

Type of change

Checklist

Kumar06Lav commented 2 months ago

Hi team, I'd like to take on this issue. Could you please assign it to me? Thanks!