MCPcopy
hub / github.com/facebook/react / jsonChildToJSXChild

Function jsonChildToJSXChild

packages/jest-react/src/JestReact.js:100–112  ·  view source on GitHub ↗
(jsonChild)

Source from the content-addressed store, hash-verified

98}
99
100function jsonChildToJSXChild(jsonChild) {
101 if (jsonChild === null || typeof jsonChild === 'string') {
102 return jsonChild;
103 } else {
104 const jsxChildren = jsonChildrenToJSXChildren(jsonChild.children);
105 return createJSXElementForTestComparison(
106 jsonChild.type,
107 jsxChildren === null
108 ? jsonChild.props
109 : {...jsonChild.props, children: jsxChildren},
110 );
111 }
112}
113
114function jsonChildrenToJSXChildren(jsonChildren) {
115 if (jsonChildren !== null) {

Callers 2

Calls 2

Tested by

no test coverage detected