Solid App to Web Component (js file)

I'm making a single page app in solid and Vite. Can I build my entire solid component to Web Component (single js file) ? I don't want to change each component to web component, i have a lot of components. Should I change each component to web component manually?
8 Replies
Alex Lohr
Alex Lohr15mo ago
There's solid-element. You only need to export the app as a web component, if you don't want to re-use the parts in separation.
musiclover
musiclover15mo ago
Is this right? It doesn't work.
Alex Lohr
Alex Lohr15mo ago
You need to register the custom element in the JSX namespace. I don't know what the error for '.MyApp' could be.
musiclover
musiclover15mo ago
It doesn't show web component example...
Alex Lohr
Alex Lohr15mo ago
Oh, sorry, outdated link, I suppose.
Alex Lohr
Alex Lohr15mo ago
GitHub
Declare web component in solid typescript · Issue #616 · solidjs/so...
have been tried implement web component in solid typescript but i dont really know how to declare the component name, it show an error like this. i have tried to declare it on file declaration.d.ts...
Alex Lohr
Alex Lohr15mo ago
They show the code there, too.