preact: My IDE report Error `Its type '"p"' is not a valid JSX element type.`
I imported preact into my project and the project worked successfully. However, the VSCode had always the following error message:
I can use // @ts-expect-error
to shield this error, but I want to get a more gentle way to deal with this.
Could anyone help? 🤜🏽
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (8 by maintainers)
I see there is a recent bug in Typescript that looks similar: https://github.com/microsoft/TypeScript/issues/53939. Maybe the extension was using the nightly version with this bug.
Well, my VSCode had the ms-vscode.vscode-typescript-next extension installed. I disabled it, and that seemed to fix the problem, at least for me. Sorry, I didn’t check that at first.