MCPcopy
hub / github.com/antvis/Infographic / getRenderableChildrenOf

Function getRenderableChildrenOf

src/jsx/utils/children.ts:4–20  ·  view source on GitHub ↗
(element: JSXNode)

Source from the content-addressed store, hash-verified

2import { nodeToRenderableNodes } from './element';
3
4export function getRenderableChildrenOf(element: JSXNode): RenderableNode[] {
5 if (
6 element === null ||
7 element === undefined ||
8 typeof element === 'boolean'
9 ) {
10 return [];
11 }
12
13 if (Array.isArray(element)) return nodeToRenderableNodes(element);
14
15 if (typeof element === 'object') {
16 return nodeToRenderableNodes(element.props?.children);
17 }
18
19 return [element];
20}

Callers 6

processElementFunction · 0.90
renderFunction · 0.90
performLayoutFunction · 0.90
jsx.test.tsxFile · 0.90
children.test.tsFile · 0.90
children.test.tsxFile · 0.90

Calls 1

nodeToRenderableNodesFunction · 0.90

Tested by

no test coverage detected