I delved into the realm of TypeScript and SolidJS, only to stumble upon this interesting discovery.
https://i.sstatic.net/CGvKm.png
import { Component } from "solid-js"
const Button:Component=({onClick})=>{
return <button onClick={onClick}>Button</button>
}
export default Button
Despite my components being riddled with error highlights, the project runs smoothly, even the functions passed in onClick
.
Could this be a misconfiguration in VSCode? I usually code in React.
The file extension is .tsx:
tsconfig.json
{
"compilerOptions": {
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"types": ["vite/client"],
"noEmit": true,
"isolatedModules": true,
"paths": {
"@": ["./src"],
"@/*": ["./src/*"],
"$lib":["./src/lib"],
"$lib/*":["./src/lib/*"]
}
}
}
Check out the repository solidjs