You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, thanks for creating such a lightweight/performant library! I think this library could improve on its api slightly to make it easier to use in an application using refs. Instead of returning a ref as the first return value, it would be more flexible if it could be passed in as the first argument to useDimensions:
Sadly it would mean having to call useRef anyway and ignoring the result because of the rules of hooks. I can't think of a way around that, but I do agree it could be useful.
(Actually, in this case it would be safe to assume that we'd always get the ref and therefore would never call the useRef, but that's a bit hacky)
Hey, thanks for creating such a lightweight/performant library! I think this library could improve on its api slightly to make it easier to use in an application using refs. Instead of returning a ref as the first return value, it would be more flexible if it could be passed in as the first argument to useDimensions:
This would make it easier to work with other libraries, such as useScrolling:
I would be more than happy to make a PR for this change, however, I understand if you wouldn’t want to introduce this change as it would be breaking.
The text was updated successfully, but these errors were encountered: