DenoDDeno
Powered by
WerdoxW
Denoβ€’2y agoβ€’
1 reply
Werdox

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/...
@types/...
declaration, I have to use the
// @deno-types="@types/..."
// @deno-types="@types/..."
directive.

this is fine except when
react
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
esm.sh
for this case but I don't know if it's a good idea to have
npm:package
npm:package
,
https://esm.sh/...
https://esm.sh/...
,
jsr:package
jsr:package
mixed in the deno.json imports.

TLDR:

- react does not have types so
@deno-types="..."
@deno-types="..."
is tedious in every file
- Should I use
esm.sh
esm.sh
for this package instead or it's a bad idea?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

React types without @deno-types before every import?
Steve ASSteve A / help
14mo ago
Deno Types
mostprodevMmostprodev / help
3y ago
`deno run` ignores @deno-types?
DarveshDDarvesh / help
3y ago
`deno bundle` and React Router
chaosharmonicCchaosharmonic / help
8mo ago