Server Side
To defer a prop, you can use theInertia::defer() method when returning your response. This method receives a callback that returns the prop data. The callback will be executed in a separate request after the initial page render.
Grouping Requests
By default, all deferred props get fetched in one request after the initial page is rendered, but you can choose to fetch data in parallel by grouping props together.teams, projects, and tasks props will be fetched in one request, while the permissions prop will be fetched in a separate request in parallel. Group names are arbitrary strings and can be anything you choose.
Client Side
On the client side, Inertia provides theDeferred component to help you manage deferred props. This component will automatically wait for the specified deferred props to be available before rendering its children.
Multiple Deferred Props
If you need to wait for multiple deferred props to become available, you can specify an array to thedata prop.
Reloading Indicator
When deferred props are being reloaded via a partial reload, theDeferred component exposes a reloading boolean through its slot. This allows you to show a loading indicator while still displaying the previously loaded data.
reloading prop is false on the initial load and becomes true whenever a partial reload is in progress for the deferred keys. It returns to false once the reload completes.
Combining with Once Props
You may chain theonce() modifier onto a deferred prop to ensure the data is resolved only once and remembered by the client across subsequent navigations.