onClick not staying with preact-render-to-string?
Hello, I'm trying to make an SSR application by rendering components to strings. However, I need a button to have some JavaScript capabilities and unfortunately Preact seems to be removing it. How can I work around this? I'd like to continue rendering it to a string if possible. Thanks!
6 Replies
You cannot serialize functions with render to string
What's the alternative?
Hydrate the comoponents that u want on client
Or use fresh which already does that
But Iām not sure how to do it sorry š
Ahhhh, hydration - I forgot about that. Thanks for your help!
GitHub
GitHub - preactjs/preact-iso: Isomorphic utilities for Preact
Isomorphic utilities for Preact. Contribute to preactjs/preact-iso development by creating an account on GitHub.
Maybe that can help