Sanity Library Reference Docs
    Preparing search index...

    Interface Router

    interface Router {
        __unsafe_disableScopedSearchParams?: boolean;
        children: RouteChildren;
        decode: (path: string) => RouterState;
        encode: (state: RouterState) => string;
        getBasePath: () => string;
        getRedirectBase: (pathname: string) => string;
        isNotFound: (path: string) => boolean;
        isRoot: (path: string) => boolean;
        route: Route;
        scope?: string;
        transform?: { [key: string]: RouteTransform<RouterState> };
    }

    Hierarchy (View Summary)

    Index

    Properties

    __unsafe_disableScopedSearchParams?: boolean

    Optionally disable scoping of search params Scoped search params will be represented as scope[param]=value in the url Disabling this will still scope search params based on any parent scope unless the parent scope also has disabled search params scoping Caution: enabling this can cause conflicts with multiple plugins defining search params with the same name

    children: RouteChildren

    The child nodes of this node. See RouteChildren

    decode: (path: string) => RouterState

    Decodes the specified path string into a router state. See RouterState

    encode: (state: RouterState) => string

    Encodes the specified router state into a path string. See RouterState

    getBasePath: () => string

    Gets the base path of this router.

    getRedirectBase: (pathname: string) => string

    Gets the redirect base of this router.

    isNotFound: (path: string) => boolean

    Determines whether the specified path is not found.

    isRoot: (path: string) => boolean

    Determines whether the specified path is the root path.

    route: Route

    The route information for this node. See Route

    scope?: string

    An optional scope for this node.

    transform?: { [key: string]: RouteTransform<RouterState> }

    An optional object containing transforms to apply to this node. See RouteTransform and RouterState