Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add useScrollHeight hook #2592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Muhammad-21
Copy link

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:

  • Updating the layout or styling of an element based on its scroll height
  • Monitoring the scroll height of a container element to trigger certain actions

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as before)

Checklist

  • Read the Contributing Guide
  • Perform a code self-review
  • Comment the code, particularly in hard-to-understand areas
  • Add documentation
  • Add hook's story at Storybook
  • Cover changes with tests
  • Ensure the test suite passes (yarn test)
  • Provide 100% tests coverage
  • Make sure code lints (yarn lint). Fix it with yarn lint:fix in case of failure.
  • Make sure types are fine (yarn lint:types).

@Kumar06Lav
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants