MCPcopy Create free account
hub / github.com/bytebase/bytebase / renderIntoContainer

Function renderIntoContainer

frontend/src/react/components/RouterLink.test.tsx:28–43  ·  view source on GitHub ↗
(element: ReactElement)

Source from the content-addressed store, hash-verified

26let RouterLink: typeof import("./RouterLink").RouterLink;
27
28const renderIntoContainer = (element: ReactElement) => {
29 const container = document.createElement("div");
30 const root = createRoot(container);
31 return {
32 container,
33 render: () => {
34 act(() => {
35 root.render(element);
36 });
37 },
38 unmount: () =>
39 act(() => {
40 root.unmount();
41 }),
42 };
43};
44
45function getLink(container: HTMLElement): HTMLAnchorElement {
46 const link = container.querySelector("a");

Callers 1

Calls 1

renderMethod · 0.80

Tested by

no test coverage detected