(builder: RouteBuilder<Params, Search>)
| 12 | type PushOptions = Parameters<ReturnType<typeof useRouter>["push"]>[1]; |
| 13 | |
| 14 | export 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 | |
| 28 | export function useParams< |
| 29 | Params extends z.ZodSchema, |
nothing calls this directly
no outgoing calls
no test coverage detected