nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

Prevent re-render / re-paint of a page when you press the browser back button

Open connecteev opened this issue 4 years ago • 3 comments

What problem does this feature solve?

I am trying to prevent the page from re-rendering when you press the browser back button in Nuxt in SSR mode. How can this be implemented, is there an example of this?

To see this in action on dev.to:

  • Go to https://dev.to/
  • By default, the page should about 45 posts in the news feed.
  • Scroll down on the infinite-loaded page so that new posts are loaded in the news feed.
  • Click on the title of any post to go to that post view page.
  • Click the browser's back button so you go back to https://dev.to/
  • Notice that you are taken back to the news feed in the EXACT same state you left it in:
  1. The page is NOT re-painted or re-rendered
  2. All the posts that were loaded by scrolling down the page (part of the infinite scroll) are preserved.

I want to do the same in my app, and prevent the re-paint / re-render. How can this be implemented in Nuxt.js in Universal (SSR) mode?

This feature request is available on Nuxt community (#c9807)

connecteev avatar Sep 22 '19 21:09 connecteev