3 ms·
Can anyone comment on how best to use Vue 3 with TypeScript to avoid as many runtime errors as possible? I know you can use JSX/TSX with Vue but it doesn't seem
by seanwilson 5y ago
Can anyone comment on how best to use Vue 3 with TypeScript to avoid as many runtime errors as possible? I know you can use JSX/TSX with Vue but it doesn't seem a focus.
I've worked on projects that use Vue 2 HTML templates + TypeScript before and a big chunk of the bugs are clustered around where TypeScript is interacting with the HTML templates.
- darrinmn 5y agoThe Vue community is not against JSX. I know many Vue devs that use it and it works great. Have you encountered any problems with vue+jsx/tsx?
- seanwilson 5y agoThat's good to know. Do you know of any open source Vue + JSX + TypeScript projects I can browse for examples? Or good docs on using Vue with JSX? The official docs still look brief about this with the focus being on HTML templates? Are there any problems with Vue + JSX + TypeScript when you want to use Vue UI component libraries that use Vue + HTML? Will you be giving up any static type checking here?
- rhengles 5y agoThe best example I ever saw, and a great UI framework/component library on top of it, it's NaiveUI - www.naiveui.com . The code is all in JSX + Typescript, I didn't find a single component with html templates.
- zigomir 5y agouse vue-tsc package + Volar VSCode plugin to get type checking in templates. works great!