Subscribe on changes!

Automatic JSX factory import causing issue with TypeScript

avatar
May 11th 2020

Do NOT ignore this template or your issue will have a very high chance to be closed without commdent.

Describe the bug

TypeScript doesn't like it if the JSX factory isn't imported in the code, even though Vite auto-imports them. (using the jsx: 'preact' option, project folder created with --template preact)

image

System Info

  • vite version: 0.14.2
  • Operating System: Arch Linux
  • Node version: 14.2.0
avatar
May 13th 2020

What's your TS config like? If you are using jsx: 'preserve' in your tsconfig it shouldn't care about how JSX is compiled.

avatar
May 13th 2020

ah, i feared that might have been the case, i didn't know the implications. using preserve removes the error, but it removes the type checking for intrinsic elements

however, safe to say that this issue can be closed now! :slightly_smiling_face: