Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent storing page props cache when in SSG + preview mode #30757

Merged
merged 5 commits into from
Nov 2, 2021

Commits on Nov 1, 2021

  1. Prevent storing page props cache when in SSG + preview mode

    In Next 12, `router.replace()` treats the page props cache as authoritative when fetching SSG props in preview mode. This makes sense outside preview mode (static props won't change), but within preview mode this prevents reloading the preview data dynamically without force-refreshing the page.
    
    This PR fixes the problem by instructing Next to bypass the props cache not only if it's an SSG route, but also only if preview mode is off.
    
    Repro: https://github.com/kamsar/next-replace-previewmode-staticprops/blob/main/pages/index.js
    kamsar committed Nov 1, 2021
    Configuration menu
    Copy the full SHA
    c7cf09f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3199a73 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    93a9420 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2021

  1. Configuration menu
    Copy the full SHA
    b7fb4f7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2d3c359 View commit details
    Browse the repository at this point in the history