From all the available JavaScript frameworks, Iā€™d say that Vue and React are my favorites. React for its vast ecosystem, great TypeScript support, JSX, and Vue for its simplicity, performance, and some smaller life quality improvements, like auto-passing props, easy-to-use transitions system, directives, slots & more.

So, how about getting the best of both worlds? Get Vueā€™s benefits in React would mean making React into Vue, so thatā€™s not an option. How to use TypeScript and JSX in Vue then?

Well, Vue is heavily reliant on its custom templating syntax and SFCs (Single File Components). However, itā€™s also very ā€œunopinionatedā€ and provides its users with many ways of doing the same thing. This includes using JSX, even TSX (JSX with TypeScript)! Sadly, when you do many things well, you usually canā€™t do a single thing great. Let me demonstrate that through Vue 2ā€™s TSX support.

Vue 2 TSX Support

Letā€™s start with pure JSX. A quick search on Vue 2 docs brings the following results:

The entirety of Vue 2 docs on JSX

#vue #typescript #framework #library

Vue with TSX - The Perfect Duo!?
1.40 GEEK