Closed fragkp closed 3 weeks ago
Hey! I just tried to reproduce this issue and wasn't able to. Both the page props passed to the page component, as well as the $page.prop
property and usePage()
values were all still set after doing a partial reload.
You can see my test here:
https://github.com/inertiajs/inertia/blob/issue-1883/playgrounds/vue3/resources/js/Pages/Users.vue
We did recently make some changes to how partial reloads work (see #1876 and #1877), so it's entirely possible that there is some situation we didn't account for, but I am unable to reproduce it.
Are you able to provide a minimal reproduction of this issue using this Vue 3 playground?
Will create a playground later today 😃
Thanks for your quick response!
Awesome, thanks!
Unfortunately, I can't reproduce it on your playground (maybe, because we rely heavily on nested layouts with parameters?), but I found our mistake:
On our reload call
router.reload({ only: ['some-prop'] });
some-prop
is not passed to the view:
inertia('Page', array_merge([], $active ? [
'some-prop' => 'value',
] : [
// missing
]))
On 1.0.6
, when missing some-prop
will be null. On 1.0.0
it completely wipes the page props for some reason.
I'm unsure if it is a bug in the new version if inertia or some weird hack on our codebase.
Hey I think we've fixed this now in v1.2.0 👍
@reinink Testet it. Works as before. Thanks 😄
Version:
@inertiajs/vue3
version: 1.1.0Describe the problem:
When updating from 1.0.6 to 1.1.0 unexpectedly the behavior of $page props has changed. It will set all page props to undefined when a partial reload with only is called.
Steps to reproduce:
The user page prop is now undefined! It affects not only props in templates but also when usePage() is used.