MCPcopy Create free account
hub / github.com/RobPruzan/react-scratch / ListAndItemUnder

Function ListAndItemUnder

src/script.ts:453–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

451};
452
453const ListAndItemUnder = () => {
454 const [items, setItems] = React.useState([1, 2, 3]);
455
456 return React.createElement(
457 "div",
458 { style: "display:flex; flex-direction: column" },
459 React.createElement("button", {
460 innerText: "add item",
461 onclick: () => setItems([...items, items.length + 1]),
462 }),
463 React.createElement("button", {
464 innerText: "remove item",
465 onclick: () => setItems([...items.slice(0, -1)]),
466 }),
467 React.createElement("span", { innerText: "above probably bugged" }),
468 // React.createElement(
469 // "div",
470 // { style: "display:flex; flex-direction: column" },
471 ...items.map((item) => React.createElement("span", { innerText: item })),
472 // ),
473 React.createElement("div", {
474 style: "border: 2px solid black",
475 innerText: "im bugged",
476 })
477 );
478};
479
480if (typeof window === "undefined") {
481 const { reactViewTree, reactRenderTree } = React.buildReactTrees(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected