export TS types
See original GitHub issueI have a throttled onResize
handler. I found that unless I wrap in a useCallback
, the throttling doesn’t take effect because the resize handler triggers a dimension change, which triggers a rerender, which replaces the onResize
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:
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Documentation - Modules - TypeScript
The export = syntax specifies a single object that is exported from the module. This can be a class, interface, namespace, function, or...
Read more >How to export a Type in TypeScript | bobbyhadz
Use a named export to export a type in TypeScript, e.g. export type Person = {} . The exported type can be imported...
Read more >What is `export type` in Typescript? - javascript - Stack Overflow
This is a type alias - it's used to give another name to a type. In your example, feline will be the type...
Read more >Typescript Types indirect re-export with isolatedModules: true
Typescript Types indirect re-export with isolatedModules: true - index.ts.
Read more >Exporting Imported TypeScript Types - Ship Shape
We logically kept our types in separate files, i.e. the types for tour.jsx lived in tour.d.ts etc. This was great, and we thought...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just missed that there was an example for throttling, just went straight to implementing it myself.
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’m just wondering if there’s anything I could improve on the docs in your opinion to maybe better surface examples like these?