T
TanStack2y ago
sensitive-blue

Search params on the home route

I'm basing my work on the basic-ssr-streaming-file-based example and I now have a loader and loaderDeps on that route to load pages of data for the home route. The initial render works fine, I get whatever page was sent in and retrieve the data in the loader. But when I use a Link to navigate to subsequent pages the URL updates but the content of the page doesn't reload. Does that need to be in a nested route or something? I was hoping it would just update the page with the new contents.
3 Replies
flat-fuchsia
flat-fuchsia2y ago
can you share a complete example?
sensitive-blue
sensitive-blueOP2y ago
GitHub
GitHub - jherr/tanstack-router-streaming-movies: Streaming movies e...
Streaming movies example. Contribute to jherr/tanstack-router-streaming-movies development by creating an account on GitHub.
sensitive-blue
sensitive-blueOP2y ago
Unfortunately to run it requires a TMDB API key. I tried two different approaches. One with the home route and another with the search route. Neither update when the searchParams change. Oh, crap, wait, I see what's happening, when doing the nav it's running the loader on the client... Ugh. Ok. Proxying the requests through the server worked. resolved I think my misconception in comparing this to Next where when you navigate they do the server round trip to get the data.

Did you find this page helpful?