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

Function InnerWrapper

src/script.ts:257–285  ·  view source on GitHub ↗
({ counter }: any)

Source from the content-addressed store, hash-verified

255};
256
257export const InnerWrapper = ({ counter }: any) => {
258 const [innerCounter, setInnerCounter] = React.useState(0);
259
260 // this evaluates in the wrong order for our logic to work
261 // it will push it last
262 // but why does that matter ,we initially had the sassumption all that wuld matter was the view tree
263 // because we traverse the lrender node to generate the view tree, so of course that order would matter
264 // we may need a temp ds to keep track of this tree so we can properly reconstruct it
265 // the children could be useful? Using the return values instead of over complicating it
266 return React.createElement(
267 "div",
268 {
269 id: "IM AN INNER",
270 style: "border: 1px solid gray; padding: 10px; margin: 10px;",
271 },
272 React.createElement("div", {
273 innerText: "Inner Counter: " + innerCounter,
274 }),
275 React.createElement("button", {
276 onclick: () => setInnerCounter(innerCounter + 1),
277 innerText: "Increase Inner Counter",
278 }),
279 React.createElement("div", {
280 innerText: "Outer Counter Value: " + counter,
281 }),
282 React.createElement(LeafComponent, null),
283 React.createElement(ContainerComponent, null)
284 );
285};
286
287export const LeafComponent = () => {
288 return React.createElement("div", {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected