Re:Rich Harris joins Vercel to work on Svelte full time
by richeyryan on Thursday November 11, 2021 @12:02PM
(#29190245)
This is a really cool idea. This has always been my biggest beef with single file components. It never occurred to me that you could do this with Vue. Thanks for the tip
But what is unique about Vue is that it lets you arbitrarily mix ".vue" and ".jsx/.tsx" files in the same project.
So if you need to define say 50 really tiny helper components, like "Button", "Modal", etc. it's great.
I can write one TSX file and do:
And then in my .vue file I can do: This is not a popular approach, almost nobody uses Vue's JSX/TSX and I'm not sure if people even know you can mix and match arbitrarily like this.But I've been doing this for a long time and it works great for me haha.