MCPcopy
hub / github.com/TanStack/router / useSearch

Function useSearch

packages/vue-router/src/useSearch.tsx:46–71  ·  view source on GitHub ↗
(
  opts: UseSearchOptions<
    TRouter,
    TFrom,
    TStrict,
    ThrowConstraint<TStrict, TThrow>,
    TSelected
  >,
)

Source from the content-addressed store, hash-verified

44) => Vue.Ref<UseSearchResult<TRouter, TFrom, true, TSelected>>
45
46export function useSearch<
47 TRouter extends AnyRouter = RegisteredRouter,
48 const TFrom extends string | undefined = undefined,
49 TStrict extends boolean = true,
50 TThrow extends boolean = true,
51 TSelected = unknown,
52>(
53 opts: UseSearchOptions<
54 TRouter,
55 TFrom,
56 TStrict,
57 ThrowConstraint<TStrict, TThrow>,
58 TSelected
59 >,
60): Vue.Ref<
61 ThrowOrOptional<UseSearchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>
62> {
63 return useMatch({
64 from: opts.from!,
65 strict: opts.strict,
66 shouldThrow: opts.shouldThrow,
67 select: (match: any) => {
68 return opts.select ? opts.select(match.search) : match.search
69 },
70 }) as any
71}

Callers 15

LazyRouteClass · 0.90
RouteApiClass · 0.90
RouteClass · 0.90
RootRouteClass · 0.90
link.test.tsxFile · 0.90
PostsComponentFunction · 0.90
setupFunction · 0.90
setupFunction · 0.90
InsideComponentFunction · 0.90
InsideLayoutComponentFunction · 0.90
LazyInsideComponentFunction · 0.90

Calls 1

useMatchFunction · 0.90

Tested by 1

PostsComponentFunction · 0.72