-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
[BUG] Compatibility with React v19 #602
Comments
@CHE1RON I was trying to replicate the problem but I was unable to. Can you confirm it is not caused by https://react.dev/blog/2024/04/25/react-19-upgrade-guide#ref-cleanup-required ? |
thanks for letting me know, I'll confirm that and get back to you! |
Same problem here. Had to cast :( const containerElementRef = useRef<HTMLDivElement>(null)
const isHovering = useHover(containerElementRef as RefObject<HTMLDivElement>)
// ^ 😭 |
Yeah, me too, casting always feels like you were given typesafety candy and then having to give it back .. |
I'd sooner annotate with const containerElementRef = useRef<HTMLDivElement>(null)
// @ts-expect-error React 19 type compatibility, nullable ref can be ignored.
const isHovering = useHover(containerElementRef) |
encountered the same problem with |
Same happens for |
Describe the bug
Currently, when using React v19 (currently RC), it gives an error regarding
ref
objects being passed to hooks, see here:To Reproduce
Simply follow the upgrade guide and install React v19 RC, then try to build the project using
usehooks-ts
.Expected behavior
build
step succeedsAdditional context
No response
The text was updated successfully, but these errors were encountered: