primefaces / primefaces/primereact

Hook: useScrollTop target prop

Open
#8,324 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hello, I believe that the useScrollTop hook's target parameter supporting React ref in version v11 would be much more suitable for React's architecture.

React ref type:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ac1acf965f539e4a9f7ac38bd268675793ded4c1/types/react/index.d.ts#L193

prop:
https://github.com/primefaces/primereact/blob/5e06098603bed22fff841138f90bfe2b6b8fcbbb/packages/hooks/src/use-scrolltop/index.ts#L12

I think it would be more logical to use useref instead of target usestate in the hook's documentation to pass it to the target parameter.

#8253

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/hooks/src/use-scrolltop/index.ts and compare the target prop definition with the React ref type linked in the issue. Review the useScrollTop documentation mentioned in the report and issue #8253 for context. Done means the target accepts the intended React ref shape and the documented usage matches it.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.