Skip to content

[2.x] Prefetch doesn't load deferred props #2108

@javieralarcn10

Description

@javieralarcn10

Version:

  • @inertiajs/react version: 2.0.0-beta.2

Describe the problem:

When I prefetch a <Link prefetch/> it only loads props that don't have the Inertia::defer method.

Steps to reproduce:

Controller:
return inertia('Dashboard/Products/Inventory', [ 'shop' => $shop, 'inventory' => Inertia::defer(fn() => $shop->inventory), ]);

Frontened:
<Link prefetch href={route("inventory")} className="flex gap-2 items-center"> <span className="font-medium text-white">Inventory</span> </Link>

Metadata

Metadata

Assignees

No one assigned

    Labels

    prefetchingRelated to the prefetching featurereactRelated to the react adapter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions