inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.56k stars 435 forks source link

[2.x] Fix issue where initial page data is coming from history state #2023

Closed joetannenbaum closed 1 month ago

joetannenbaum commented 1 month ago

When we initially decrypt the history state so that the router can restore any remembered data, we were setting it as the current history in the History class, causing the page to be loaded from that state rather than the initial page props on the page.

The page would then load the initial page props, but you'd get a flash of stale data.

This fixes that issue by storing the restore data as a separate one-time-use property.