MCPcopy
hub / github.com/bvaughn/react-error-boundary / updateUrl

Function updateUrl

integrations/vite/tests/utils/updateUrl.ts:6–27  ·  view source on GitHub ↗
(
  page: Page,
  element: ReactElement<GroupProps> | null,
)

Source from the content-addressed store, hash-verified

4import { encode } from "./serializer/encode";
5
6export async function updateUrl(
7 page: Page,
8 element: ReactElement<GroupProps> | null,
9) {
10 const encodedString = element ? encode(element) : "";
11
12 await page.evaluate(
13 ([encodedString]) => {
14 const url = new URL(window.location.href);
15 url.searchParams.set("urlPanelGroup", encodedString ?? "");
16
17 window.history.pushState(
18 { urlPanelGroup: encodedString },
19 "",
20 url.toString(),
21 );
22
23 window.dispatchEvent(new Event("popstate"));
24 },
25 [encodedString],
26 );
27}

Callers

nothing calls this directly

Calls 1

encodeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…