Client-Side Page Rendering / Routing With Dynamic Route Segments #50466
Replies: 8 comments 5 replies
-
I'm currently facing a similar issue. I have some pages with dynamic route segments (doing client-side fetching only) and don't want the app-router fetch the same page over and over and over again. There are so many caching-related options. I absolutely don't get why the app-router isn't able to just remount a page-component when it has no server-side dependencies at all... Did you find a solution? |
Beta Was this translation helpful? Give feedback.
-
Perhaps this should be a bug report? When you build, do you see these dynamic routes as SSR (denoted by λ) or SSG (denoted by ○)? |
Beta Was this translation helpful? Give feedback.
-
You can achieve this by using Route Segment Config add this line of code to your page |
Beta Was this translation helpful? Give feedback.
-
Ya same 👍 I am statically generating my app so I can compile it with Tauri into a mobile app. It's been working great -- a nextjs app inside a web view compiled by tuari? it feels soooo smooth! Except for the inability to declare client routes like |
Beta Was this translation helpful? Give feedback.
-
Is there any update on the above? |
Beta Was this translation helpful? Give feedback.
-
Nextjs doesn't support it. Similar thread. If you can get away with query params, that's probably the best way togo for now. |
Beta Was this translation helpful? Give feedback.
-
Why can't we have nice things? This is like the basic of the basics, unbelievable 😂 |
Beta Was this translation helpful? Give feedback.
-
![]() |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to have a page with a dynamic route rendered entirely on the client?
Take for example a page at /app/posts/[id]/page.tsx
With the App Router, is it possible to statically export that page as /posts/[id].html and have it serve [id].html to be rendered on the client with access to the id param? My use case is that I am trying to serve a page with params that may not be known at build time and want the client to be able to load the page data using client side fetches and not have to depend on a Node backend.
It has been suggested to me to remove the dynamic route segment and instead use React Router inside of a /posts.html page but I had hoped that the new App Router could be used instead.
Beta Was this translation helpful? Give feedback.
All reactions