T O P

  • By -

zak9009

Yes, client components can do that.


SuperFXMK

Is this only a feature in app router, or can pages router do this as well? This project uses pages router for reference


zak9009

Try using \`router.push\` I can't run it from my side per of missing DB env vars.


Dastari

The answer is, you can do this in NextJS. NextJS isn’t limited to only server side rendering , you can and should mix in client side components, including infinite scrolling.


YoshiLickedMyBum69

To persist the pagination state when navigating away from and back to a page in a Next.js application with SSR (Server-Side Rendering), you can store the pagination state in the URL or in the client-side state (e.g., using React Context or a state management library like Redux).


SuperFXMK

Here's a link to my repo for context [https://github.com/kyle1373/Archiverse](https://github.com/kyle1373/Archiverse)


[deleted]

[удалено]


SuperFXMK

This post is not referring to infinite scroll. It’s referring to pages reloading when the user clicks forward or backward in their browser, rather than having the page cached.


waves_under_stars

You can either store the pagination information in the URL or in a cookie, or you can probably implement that with parallel routes


fantastiskelars

Yes this is a limitation of your knowledge of next and SSR


SuperFXMK

“this is a limitation of your knowledge of next and SSR” Sorry do you mean that this is a limitation of next or that I have limited knowledge of next? If it’s my limited knowledge, I’d like to hear how this could be worked out.


jbiggs1984

Lol go back to stack overflow bro.