S
SolidJS17mo ago
Ryan

How to stop VS Code from erroring with `Cannot find name 'React'.ts(2304)`?

VS Code is complaining with Cannot find name 'React'.ts(2304) but I am not using React at all. I have both of these in my ts config:
"jsx": "preserve",
"jsxImportSource": "solid-js",
"jsx": "preserve",
"jsxImportSource": "solid-js",
How to I avoid this issue in VS Code?
3 Replies
Grahf
Grahf17mo ago
I'm curious how you made the app. Did you run: npx degit solidjs/templates/js my-app?
Ryan
RyanOP17mo ago
No, that application was more of less built from scratch manually more of less (it was a while ago so I don't remember 100%)
Only Cliches
Only Cliches10mo ago
If you have an "include" property in tsconfig.json with directories listed, but you create a tsx file outside the included directories, this problem will happen. Either move your tsx file to an included directory or add the directory to the "include" property in tsconfig.json.
Want results from more Discord servers?
Add your server