MCPcopy Create free account
hub / github.com/ctrlplusb/react-tree-walker / getChildren

Function getChildren

src/index.js:58–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57// Preact puts children directly on element, and React via props
58const getChildren = element =>
59 element.props && element.props.children
60 ? element.props.children
61 : element.children
62 ? element.children
63 : undefined
64
65// Preact uses "nodeName", React uses "type"
66const getType = element => element.type || element.nodeName

Callers 1

recursiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected