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 Lohr2y 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
musicloverOP2y ago
Is this right? It doesn't work.
Alex Lohr
Alex Lohr2y ago
You need to register the custom element in the JSX namespace. I don't know what the error for '.MyApp' could be.
musiclover
musicloverOP2y ago
It doesn't show web component example...
Alex Lohr
Alex Lohr2y ago
Oh, sorry, outdated link, I suppose.
Alex Lohr
Alex Lohr2y 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 Lohr2y ago
They show the code there, too.
Want results from more Discord servers?
Add your server