Basic Usage
To make an instant visit, provide the targetcomponent name to a Link or to router.visit().
Dashboard component while the server request fires in the background. The full props are merged in when the response arrives.
The target component must be able to render without its page-specific props, as only shared props are available on the intermediate page. You may use optional chaining or conditional rendering to handle missing props.
Programmatic instant visits work the same way via the component option on router.visit().
Shared Props
The Laravel adapter includes asharedProps metadata key in the page response, listing the top-level prop keys registered via Inertia::share().
auth are available immediately, while page-specific props like stats will be undefined until the server responds.
Page Props
You may provide props for the intermediate page using thepageProps option. This is useful for passing data you already have on the current page, or for setting placeholder values to display loading states while the server responds.
pageProps is provided as an object, shared props are not automatically carried over. You are in full control of the intermediate page’s props.
A callback may also be passed to pageProps. The callback receives the current page’s props and the shared props as arguments, so you may selectively spread them.
Wayfinder Integration
When using Wayfinder, you may use theinstant prop on the Link component. Inertia will extract the target component from the Wayfinder route definition, removing the need to manually specify the component prop.
instant prop is also available on the Form component.
component prop always takes priority over instant.
Wayfinder Configuration
To include component information in your Wayfinder route definitions, enable thegenerate.inertia.component option in your config/wayfinder.php configuration file.
config/wayfinder.php
Disabling Shared Prop Keys
You may disable thesharedProps metadata key in your config/inertia.php configuration file. The server will still resolve and include shared prop values in the response, but the metadata listing which keys are shared will be omitted. Without this list, the client cannot identify which props to carry over during instant visits.
config/inertia.php