robtaussig / react-use-websocket

React Hook for WebSocket communication
MIT License
1.63k stars 135 forks source link

Add 'types' field to package.json #96

Closed snendev closed 3 years ago

snendev commented 3 years ago

Hi, I hope this is the right way to contribute here -- it seemed like a small enough suggestion that a preceding issue would have been too much.

I'm currently experimenting with a react project using deno, but I can't import the types for react-use-websocket. This isn't terribly surprising since deno has its own rules, and as a result (edit: of deno's rules) I have been importing react-use-websocket via either esm.sh or skypack which are deno-friendly CDNs that pull from the npm registry.

While investigating, I found the change submitted in this PR, which is strongly encouraged in both the typescript docs and the skypack docs.

I think npm pulls from the built /dist folder whether or not this field is specified, but this change should help other CDNs find and support this repository's types. Thanks for your time!

robtaussig commented 3 years ago

@sullivansean27,

So sorry about how delayed this is -- Merged and will publish shortly. Thank you so much!

robtaussig commented 3 years ago

Published to 2.9.0