-
I have been loving using leptos! Thank you for the wonderful project! I am having some difficulties that probably amount to me not understanding how things work. I have read the manual multiple times and haven't been able to figure it out. This post may be long, but bear with me. I am trying to build an application which reactively handles async requests to a server. In short, I have some routes defined something like:
The idea is that I have some foo objects that have some nested bars in them. I want to be able to view the detail view for the foo without loading the nested bars. So, my xx view uses the The problem I am seeing is that clicking on this anchor rerenders the entire page even though the url changes from, say, "/foos/1" to "/foos/1/bars". My expectation is that just the "yy" view would be filled in without re-querying the server function that gives the detailed foo view. I am using an actix backend. It is pretty clear to me that the server function is never called in "client mode" where a request is made back to the server to gather additional data. I must be doing something wrong. Some things I pretty clearly don't understand:
If I need to create a minimized example to show the behavior I am seeing, I am sure I can do that. I just suspect I am completely misunderstanding something that could be cleared up without that... Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This sounds like the actual issue to me. The rest of what you're doing sounds fine. If you are using the router, you are not using islands, and the page has hydrated correctly, click an There are no other warnings or errors in the browser console? If not, then some more code to look at, or a minimal example, would be helpful. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick response! After starting to put together a minimal example, I found that I had forgotten to put in the Hydration tag in my html, so hydration was never happening! That mostly fixes things, except I am currently getting some duplication in my page, which I hope I will be able to debug myself. |
Beta Was this translation helpful? Give feedback.
This sounds like the actual issue to me. The rest of what you're doing sounds fine. If you are using the router, you are not using islands, and the page has hydrated correctly, click an
<a>
should not do a full server round-trip.There are no other warnings or errors in the browser console?
If not, then some more code to look at, or a minimal example, would be helpful.