jaredLunde / jaredLunde/react-hook
useMouse()
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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