Closed ProspectPyxis closed 2 years ago
The Astro extension does not run inside tsx
files 😅
You're missing the required tsconfig.json
settings for TypeScript for Solid, that's why you're seeing this error:
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "solid-js",
}
Ah, oops. :sweat_smile: Apologies for the user error, it only happened when I was using astro with solid so I assumed, haha.
Describe the Bug
Solid's control flow elements (
<Show>
,<For>
, etc.) requires children elements to be passed. However, using the normal syntax with closing tags throws an error in the editor, requiring you to directly define thechildren
prop manually. The component does compile when runningnpm run dev
, so I can confirm it's just an editor issue.Steps to Reproduce
npm create astro@latest
. Select the "Completely empty" template, and enable solidjs integration.src
, create a new.tsx
file and paste in the following:const TestComponent: Component = () => { return (
{num}
} />) }
export default TestComponent
<Show>
and<For>
now throws an error: