stax-monorepo
    Preparing search index...

    Interface MetaArgs<P, SP, D>

    Arguments passed to meta field functions.

    data is conditional on whether the route has a loader:

    • No loader → D = never → data: undefined (nothing to read).
    • With loader → D is the loader's return type → data: D (the loaded value).

    Meta functions declared on loader-having routes see data as the concrete type without the | undefined mixed in — the fact that a bare route's data is undefined at runtime doesn't leak into every consumer.

    interface MetaArgs<P = unknown, SP = unknown, D = unknown> {
        data: [D] extends [never] ? undefined : D;
        params: P;
        searchParams: SP;
    }

    Type Parameters

    • P = unknown
    • SP = unknown
    • D = unknown
    Index
    data: [D] extends [never] ? undefined : D
    params: P
    searchParams: SP