MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / usePush

Function usePush

assets/nextjs/hooks.ts:14–26  ·  view source on GitHub ↗
(builder: RouteBuilder<Params, Search>)

Source from the content-addressed store, hash-verified

12type PushOptions = Parameters<ReturnType<typeof useRouter>["push"]>[1];
13
14export function usePush<
15 Params extends z.ZodSchema,
16 Search extends z.ZodSchema = typeof emptySchema
17>(builder: RouteBuilder<Params, Search>) {
18 const { push } = useRouter();
19 return (
20 p: z.input<Params>,
21 search?: z.input<Search>,
22 options?: PushOptions
23 ) => {
24 push(builder(p, search), options);
25 };
26}
27
28export function useParams<
29 Params extends z.ZodSchema,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected