Skip to content

Leptos store & SSR vs client side reactivity #3185

Answered by gbj
s1n7ax asked this question in Q&A
Discussion options

You must be logged in to vote

I'm just guessing somehow Leptos knows how to reference each component to actual DOM element so it does not need any initial render on browser.

This is the gap in understanding. Like any framework that hydrates, yes, Leptos will run your application code once on the server (to generate HTML) and then once on the client (to add interactivity to that HTML). That means that if you do something expensive in your logic, it happens in each of those places.

"Hydrate the HashMap" would mean something like "serialize the keys and values of the HashMap, send that as JSON from the server to the client, then deserialize it into a new HashMap on the client." In any framework and any programming lang…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@s1n7ax
Comment options

@gbj
Comment options

gbj Nov 4, 2024
Maintainer

Answer selected by s1n7ax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants