moshicode
moshicode

Reputation: 21

Infinate scroll next js 13 keep data and position when back

I implement infinate scroll with server actions on nextjs 13 and I get strgle to solve it.

When the user scroll and load more items and then click on item, and then back with the browser history. Its not keep the state data that already loaded with server actions.

How can I solve that when the user scroll and load more items and then click on one of them and back, he should be back to the same data and on the same position that he left.

I tought about using cookies but not sure

Upvotes: 1

Views: 701

Answers (0)

Related Questions