MCPcopy Create free account
hub / github.com/bvaughn/react-window / decodeChildren

Function decodeChildren

integrations/tests/src/utils/serializer/decode.ts:23–51  ·  view source on GitHub ↗
(children: EncodedElement[])

Source from the content-addressed store, hash-verified

21}
22
23function decodeChildren(children: EncodedElement[]): ReactElement<unknown>[] {
24 const elements: ReactElement<unknown>[] = [];
25
26 children.forEach((current) => {
27 if (!current) {
28 return;
29 }
30
31 switch (current.type) {
32 case "List": {
33 elements.push(decodeList(current));
34 break;
35 }
36 case "RowComponent": {
37 elements.push(decodeRowComponent(current));
38 break;
39 }
40 case "Text": {
41 elements.push(decodeText(current));
42 break;
43 }
44 default: {
45 console.warn("Could not decode type:", current);
46 }
47 }
48 });
49
50 return elements;
51}
52
53function decodeList(
54 json: EncodedListElement

Callers 1

decodeFunction · 0.85

Calls 3

decodeListFunction · 0.85
decodeRowComponentFunction · 0.85
decodeTextFunction · 0.85

Tested by

no test coverage detected