• Prefetches components and data of routes matched by a location after a component has mounted.

    Parameters

    • to: To

      A location or a route to prefetch.

    Returns void

    const productRoute = createRoute('/product/:sku');

    usePrefetch(productRoute.getLocation({ sku: 37 }));