MCPcopy Index your code
hub / github.com/MainframeOS/react-json-renderer / createChild

Function createChild

src/renderer.js:28–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 const fallback = (params && params.fallback) || Fallback
27
28 const createChild = c => {
29 if (c == null) {
30 return null
31 }
32 if (Array.isArray(c)) {
33 return c.map(createChild)
34 }
35 if (
36 typeof c === 'boolean' ||
37 typeof c === 'number' ||
38 typeof c === 'string'
39 ) {
40 return c
41 }
42 if (c.type) {
43 return createFromObject(c)
44 }
45 return null
46 }
47
48 const createFromObject = (converted: ConvertedElement) => {
49 const component = components[converted.type] || fallback

Callers 1

createFromObjectFunction · 0.85

Calls 1

createFromObjectFunction · 0.85

Tested by

no test coverage detected