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

Function renderIntoContainer

frontend/src/react/components/ExprEditor.test.tsx:126–143  ·  view source on GitHub ↗
(element: ReactElement)

Source from the content-addressed store, hash-verified

124]);
125
126const renderIntoContainer = (element: ReactElement) => {
127 const container = document.createElement("div");
128 document.body.appendChild(container);
129 const root = createRoot(container);
130
131 act(() => {
132 root.render(element);
133 });
134
135 return {
136 container,
137 unmount: () =>
138 act(() => {
139 root.unmount();
140 container.remove();
141 }),
142 };
143};
144
145const flushEffects = async () => {
146 await act(async () => {

Callers 1

Calls 2

renderMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected