Proper methodology for creating UI Component Library for SSR?
I'm looking to create a simple UI componentl ibrary for use in my solid-start projects. In some of the components I'm utilizing client only API for sake of better component functionality (utilizing setTimeout for determining a long press for example). This obviously causes hydration errors in solid-start unless I wrap the component in
clientOnly
I can't seem to export client only components from my library, as solid-start doesn't seem to recognize them as client only, even though I export them wrapped. I could create a layer in my solid-start application where I import it from the library and wrap them in clientOnly() there, but that feels weird.
Is there a "right" way to do something like this? Some industry standard I'm unaware of? Happy to hear all opinions.1 Reply
Best way is to keep client only things in either onMount if you just initialise something or inside event handlers.