Re:Alpine.js
by abdusco on Friday January 13, 2023 @06:05AM
(#34366250)
Can you use Preact to build on server-rendered HTML?
[ Parent
| on HN ]
I have. We used stimulusjs otherwise and wrote a controller that took in a component name and JSON props (embedded in HTML as a data attribute).
It works well. You end up with HTML like:
<div data-controller=“component” data-name-component-value”example” data-props-component-value=“{a: 1}”></div>