Kitura
Kitura
DDeno
Created by Kitura on 12/4/2024 in #help
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";
// @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.
7 replies