-
-
Notifications
You must be signed in to change notification settings - Fork 43
useResizeObserver ref type aligned with useRef #13
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
Conversation
MutableRefObject<any> is what useRef returns. With this change, the refs are interchangeable. This also allows it to be placed on more elements without TypeScript complaining.
I'm sorry I didn't answer for so long, I'm quite busy with work / personal life stuff at the moment and as I don't know TypeScript I have no way to confirm this change. Could you recommend articles / docs where I could confirm what it means that you did here? I need to up my TypeScript game at some point anyway 😅 |
I'm actually thinking of just removing TS support now. 🤷♂️ |
The PR works, it fixes the issue I referenced. It does so in the typing source, rather than being patched upon usage. The original typing was wrong, and too restrictive to the intended elements to place it on. |
I'd rather just not bother with types as I have no way of ensuring they're right. Not to mention it's blocking changes I would've released ages ago otherwise: |
I've got my fork, have fun over here then |
It's annoying that TS would force you to fork a lib like this. |
TS isn't what forced the fork, making a PR to fix an issue did that. But the maintainer removing TS because learning is hard, and forcing solutions like hencatsmith did above is a good reason continue using that fork, and not look back on this repo. |
Ugh, sorry that I made you do all that effort, must've been horrible, I can't imagine the hours you must've spent on it. 🙄 "learning is hard" Can't believe even at this level people get annoyed when the maintainer doesn't do exactly what they want with a lib he spent countless hours on already. Have fun with your fork of free code, I have no time for such toxicity in my life. |
MutableRefObject is what useRef returns. With this change, the refs are interchangeable.
This also allows it to be placed on more elements without TypeScript complaining. Solves #12