-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
export TS types #98
Comments
Yeah I see no reason not to 🤔 |
The following types were exported so that it's easier to compose hook options: - ObservedSize - ResizeHandler - ResizeObserverBoxOptions - RoundingFunction Tests were updated as well to guarantee the new API interface. Resolves #98
# [9.1.0-alpha.1](v9.0.2...v9.1.0-alpha.1) (2022-11-21) ### Features * Exported some TS types ([e056e19](e056e19)), closes [#98](#98)
🎉 This issue has been resolved in version 9.1.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@holic could you check if the above mentioned alpha release addresses this as expected? |
Looks great, thank you! On the original motivation/need for this, is it expected that the resize handler reference (when re-rendering) is not "stable"? Is it expected that we should wrap our (just passing in the |
Great! On throttling, I'm not sure I understand the issue you're facing, can you share a codesandbox by any chance? On the callback: (I'll hold off on releasing until we wrap up this discussion in case there's anything else actionable here.) |
I hadn't seen the example, but it's doing what I ended up with (I just happened to thread it through All good to go here. Thank you! |
The following types were exported so that it's easier to compose hook options: - ObservedSize - ResizeHandler - ResizeObserverBoxOptions - RoundingFunction Tests were updated as well to guarantee the new API interface. Resolves #98
# [9.1.0-alpha.1](v9.0.2...v9.1.0-alpha.1) (2022-11-21) ### Features * Exported some TS types ([e056e19](e056e19)), closes [#98](#98)
🎉 This issue has been resolved in version 9.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Nice, one last question @holic if you had time: did you not find the throttle example in the docs, or did you just not think to check them at all? |
I just missed that there was an example for throttling, just went straight to implementing it myself. |
I have a throttled
onResize
handler. I found that unless I wrap in auseCallback
, the throttling doesn't take effect because the resize handler triggers a dimension change, which triggers a rerender, which replaces theonResize
handler with a new one (starting a fresh throttle timer).However, moving out the
onResize
handler means I lose out on some type inference. I don't love copying over types and would prefer to import them. Looks like this library declares types but doesn't export them, so I can't use them directly.Here's my current workaround:

The text was updated successfully, but these errors were encountered: