Websites v4 docs v12.7.0
    Preparing search index...

    Links

    You should not use the default Link component from next/link in a theme. In production it prefetches every link as soon as it scrolls into view, which sends requests to the server for each link on the page, including every property card in a list.

    Instead, use our Link component from @homeflow/v4-lib/link, which takes exactly the same props but only prefetches a link when it is hovered.

    import Link from '@homeflow/v4-lib/link';

    <Link href="/branches">Our branches</Link>;

    It can be rendered from both Server and Client Components, and does not need wrapping in ClientSideOnly.

    To stop a link prefetching at all, pass prefetch={false}. Any prefetch value passed replaces the hover behaviour.

    If the theme mounts UtmTrackingProvider, Link also adds the captured UTM params to internal links. Without the provider, hrefs are left unchanged.

    This is enforced by checkLinkImports, which every theme runs from app/[domain]/links.node.spec.ts. The check fails if any file imports the default export of next/link. Type-only imports, such as LinkProps, are allowed.

    // app/[domain]/links.node.spec.ts
    import checkLinkImports from '@homeflow/v4-lib/utils/check-link-imports';

    describe('theme links', () => {
    it('uses the lib Link instead of next/link', () => {
    expect(checkLinkImports(__dirname)).toEqual([]);
    });
    });