inertia
inertia copied to clipboard
Add ability to mutate page props
This PR allows mutating the page props with the usePage function.
This is for these situations https://github.com/inertiajs/inertia/discussions/78
You have only to do usePage().props.valueName = 'newValue'
I don't think that should be a thing. Data which loaded the page should be accessible all the time, no matter what. In case you need it to be reactive and changeable - just create a custom reference that was initialized with the prop value.
@punyflash there are definitely situations where this would be handy (eg. infinite loading), and Inertia should be more flexible about this.
I'm closing this PR since the main use case discussed here and on #78 is supporting infinite scrolling. That's already coming to v2.0 soon, as you can see in Taylor's Laracon keynote 🚀