KituraK
Deno13mo ago
Kitura

To use @types/react, do I have to prefix all my React imports with // @deno-types ?

Re: https://docs.deno.com/runtime/fundamentals/node/#importing-types

React does not ship with types, and they have to be installed at npm:@types/react.

The documentation says types have to be imported like so:
// @deno-types="npm:@types/express@^4.17"
import express from "npm:express@^4.17";


Surely I don't have to actually prefix all React imports with @deno-types? It's a lot of imports across many files.

Is there a
deno.json
solution?

What if I were to upgrade react, do I have to do a search and replace across the codebase to update the types too?

Any help is appreciated.
Deno
In-depth documentation, guides, and reference materials for building secure, high-performance JavaScript and TypeScript applications with Deno
Was this page helpful?