TanStack Hotkeys version
v0.9.1
Framework/Library version
React v18.3.1
Describe the bug and the steps to reproduce it
there are cases when when you don't want to introduce a useCallback dependency
const isCtrlKeyDown = useKeyHold('Control');
const onWheel = useCallback((event: MouseEvent) => {
// if (isCtrlKeyDown) <- needs a callback dependency
// if (isCtrlKeyDownRef.current) <- no dependency
}, []);
current implementation assumes you always rely on state
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://stackblitz.com
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
Yes, I think I know how to fix it and will discuss it in the comments of this issue
Terms & Code of Conduct
TanStack Hotkeys version
v0.9.1
Framework/Library version
React v18.3.1
Describe the bug and the steps to reproduce it
there are cases when when you don't want to introduce a useCallback dependency
current implementation assumes you always rely on state
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://stackblitz.com
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
Yes, I think I know how to fix it and will discuss it in the comments of this issue
Terms & Code of Conduct