MCPcopy
hub / github.com/molefrog/wouter / WithStatusCode

Function WithStatusCode

packages/magazin/components/with-status-code.tsx:3–18  ·  view source on GitHub ↗
({
  code,
  children,
}: {
  code: number;
  children: React.ReactNode;
})

Source from the content-addressed store, hash-verified

1import { useRouter } from "wouter";
2
3export function WithStatusCode({
4 code,
5 children,
6}: {
7 code: number;
8 children: React.ReactNode;
9}) {
10 const router = useRouter();
11
12 // Set status code on SSR context if available
13 if (router.ssrContext) {
14 router.ssrContext.statusCode = code;
15 }
16
17 return <>{children}</>;
18}

Callers

nothing calls this directly

Calls 1

useRouterFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…