jaredLunde / jaredLunde/react-hook

useMouse()

Open
#192 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.5k
Forks
96
PR merge metrics
No merged PRs in 30d

Description

OnMove/onTouchMove function under mouse.tsx got error for element variable with **Type 'T|RefObject ' is not assignable to type T.** n the line of 'dispatch({type: 'mousemove', event, element}))'

Please help to resolve the issue. I just get the src code and work on top of it without using npm compiled package.

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 in mouse.tsx at the onMove/onTouchMove handler and inspect the dispatch call containing type: 'mousemove', event, and element. Trace the element type used by useMouse() and confirm how the TypeScript error arises when it may be T or RefObject. Done means the reported type error is resolved without breaking mouse or touch event handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
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.