Werdox
Werdox5mo ago

deno and @types/react

In the docs it states that in order to use node packages that don't ship with type but have a @types/... declaration, I have to use the // @deno-types="@types/..." directive. this is fine except when react doesn't ship with types and I have to now include this directive in many many files and it also does not auto complete the import so I manually have to type the import in new files. I guess I could use esm.sh for this case but I don't know if it's a good idea to have npm:package, https://esm.sh/..., jsr:package mixed in the deno.json imports. TLDR: - react does not have types so @deno-types="..." is tedious in every file - Should I use esm.sh for this package instead or it's a bad idea?
1 Reply
halfByteMedic
halfByteMedic2mo ago
I'm now running into this problem myself a few months later. I've never heard of esm.sh till now. I didn't want to move from npm to esm.sh, I wanted to move to jsr, but..hmm..

Did you find this page helpful?