rzh9b
rzh9bā€¢5w ago

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
fro.profesional
fro.profesionalā€¢5w ago
You cannot serialize functions with render to string
rzh9b
rzh9bā€¢5w ago
What's the alternative?
fro.profesional
fro.profesionalā€¢5w ago
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 šŸ˜ž
rzh9b
rzh9bā€¢5w ago
Ahhhh, hydration - I forgot about that. Thanks for your help!
fro.profesional
fro.profesionalā€¢5w ago
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.
fro.profesional
fro.profesionalā€¢5w ago
Maybe that can help
More Posts
Deno project suddenly won't launch in VS CodeI haven't changed anything in my project or environment except having done a brew update/upgrade, whDeno BYOW help with macOS [Solved] and X11https://github.com/fazil47/deno_winit I'm trying to make Deno binding for winit for using WebGPU, iHow can I add a flag into Deno Deploy in production?Hi, I am wondering how do I add a flag in production on Deno deploy if I want to enable a certain flUploading Files to S3 Bucket usign deno-s3-lite-clientHello, I have been trying to make a file upload controller with deno's s3 lite client but I am facinDeno.cron errorHi I keep having an error on deno deploy where my cron job doesn't seem to execute well in productioHow to rewrite this: `import * as base32 from "jsr:@std/encoding@0.224.3/base32.ts";`I am migrating std from /x and I ran into this issue. What the correct way to import just base32.ts.Default export has no call signaturesI'm trying to import the default export from `npm:@feathersjs/express`, but Deno complains that the Catch/handle WebSocketStream connection reset errorHow/where to catch this error? I am using `WebSocketStream` and catching on `wss.opened` and on `wssdeno_kv_oauth + hono how to fetch data from google profile: state, plans, method names changing.In code examples i found in internet, used methods which already not the part of deno_kv_oauth. 1. Class properties being reset to undefinedWhy is this happening? I have stepped through the debugger and no matter what, if I set a property i