MCPcopy Create free account
hub / github.com/MainframeOS/react-json-renderer / convertChild

Function convertChild

src/converter.js:53–67  ·  view source on GitHub ↗
(child: ElementChild)

Source from the content-addressed store, hash-verified

51 const processProps = params.processProps || defaultProcessProps
52
53 const convertChild = (child: ElementChild): ConvertedChild => {
54 if (child == null) {
55 return
56 }
57 if (
58 typeof child === 'boolean' ||
59 typeof child === 'number' ||
60 typeof child === 'string'
61 ) {
62 return child
63 }
64 if (child.type) {
65 return convertComponent(child)
66 }
67 }
68
69 const convertChildren = (children: ElementChildren): ConvertedChildren => {
70 return Array.isArray(children)

Callers 1

convertChildrenFunction · 0.85

Calls 1

convertComponentFunction · 0.85

Tested by

no test coverage detected