question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic data not updating after prerender.

See original GitHub issue

So I created a scrollspy mixin that returns the scrollTop position via callback fn which then updates the data scrollTop like:

// this never updates after prerenderring
<pre>{{scrollTop}}</pre> 
created() {
  this.$scrollspy(scrollTop => {
    this.scrollTop = scrollTop;
  })
},
data() {
  return {
    scrollTop: 0
  }
}
new PrerenderSpaPlugin(
   path.join(__dirname, '../dist'),
   routes: ['/', '/about']
),   

This works smoothly except after prerenderring. Any thoughts?

Related issue:

https://stackoverflow.com/q/49864755/2889614

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
JoshTheDerfcommented, Jun 12, 2018

Odd, I don’t see anything that should cause the issue in any of that code. I might need to try and reproduce the issue when I’m free.

0reactions
jofftiquezcommented, Jun 12, 2018

@Tribex got it! I’m maximizing the postProcess method. 😄 Thank you so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic className in map not changing after update
I'm trying to update my react ...
Read more >
PreRender and Dynamic Addition of controls - MSDN - Microsoft
I am doing this in PRE_RENDER(need to do it in PreRender instead of Page_Load because page needs to show updated data after a...
Read more >
Dynamic Rendering | Google Search Central | Documentation
Dynamic rendering is a workaround and not a long-term solution for problems with JavaScript-generated content in search engines. Instead, we recommend that ...
Read more >
Why Dynamic Rendering Is Not a Long-Term Solution | Onely
Dynamic rendering may significantly slow down your server. A large amount of prerendering requests can make the renderer fail, so as a result, ......
Read more >
Data Fetching: getServerSideProps - Next.js
Fetch data on each request with `getServerSideProps`. ... Dynamic API Routes ... frequently updating data, and you don't need to pre-render the data, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found