Steve A
Steve A
DDeno
Created by Steve A on 1/17/2025 in #help
React types without @deno-types before every import?
I'm hoping someone can clear up a little snag for me. Is it actually necessary to include // @deno-types="npm:@types/react" above every single react import in every single file? I'm up-to-date with deno, I've got npm:@types/react in my types property of my compiler options, etc. I've been perusing issues and trying alternatives for hours, but it seems like this is the only option that actually works:
> deno --version
deno 2.1.5 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2
> deno --version
deno 2.1.5 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"strict": true,
"lib": [
"dom",
"dom.iterable",
"dom.asynciterable",
"deno.ns",
"deno.unstable"
],
"types": ["npm:@types/react", "npm:@types/react-dom"]
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"strict": true,
"lib": [
"dom",
"dom.iterable",
"dom.asynciterable",
"deno.ns",
"deno.unstable"
],
"types": ["npm:@types/react", "npm:@types/react-dom"]
},
I've generally had a great time getting things going with Deno but this has been a brick wall
14 replies