Home / Function/ jsonChildrenToJSXChildren() — react Function Reference

jsonChildrenToJSXChildren() — react Function Reference

Architecture documentation for the jsonChildrenToJSXChildren() function in JestReact.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  57be722b_59e4_4765_8d23_a700ab4dc173["jsonChildrenToJSXChildren()"]
  6e8c1123_cee1_9b1d_49c3_11cbcce7cb2e["JestReact.js"]
  57be722b_59e4_4765_8d23_a700ab4dc173 -->|defined in| 6e8c1123_cee1_9b1d_49c3_11cbcce7cb2e
  02ba167f_fe6e_f314_15bd_26d5552907e9["unstable_toMatchRenderedOutput()"]
  02ba167f_fe6e_f314_15bd_26d5552907e9 -->|calls| 57be722b_59e4_4765_8d23_a700ab4dc173
  825f3274_7f61_8309_ad58_ab8424a4b063["jsonChildToJSXChild()"]
  825f3274_7f61_8309_ad58_ab8424a4b063 -->|calls| 57be722b_59e4_4765_8d23_a700ab4dc173
  825f3274_7f61_8309_ad58_ab8424a4b063["jsonChildToJSXChild()"]
  57be722b_59e4_4765_8d23_a700ab4dc173 -->|calls| 825f3274_7f61_8309_ad58_ab8424a4b063
  style 57be722b_59e4_4765_8d23_a700ab4dc173 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/jest-react/src/JestReact.js lines 114–137

function jsonChildrenToJSXChildren(jsonChildren) {
  if (jsonChildren !== null) {
    if (jsonChildren.length === 1) {
      return jsonChildToJSXChild(jsonChildren[0]);
    } else if (jsonChildren.length > 1) {
      const jsxChildren = [];
      let allJSXChildrenAreStrings = true;
      let jsxChildrenString = '';
      for (let i = 0; i < jsonChildren.length; i++) {
        const jsxChild = jsonChildToJSXChild(jsonChildren[i]);
        jsxChildren.push(jsxChild);
        if (allJSXChildrenAreStrings) {
          if (typeof jsxChild === 'string') {
            jsxChildrenString += jsxChild;
          } else if (jsxChild !== null) {
            allJSXChildrenAreStrings = false;
          }
        }
      }
      return allJSXChildrenAreStrings ? jsxChildrenString : jsxChildren;
    }
  }
  return null;
}

Domain

Subdomains

Frequently Asked Questions

What does jsonChildrenToJSXChildren() do?
jsonChildrenToJSXChildren() is a function in the react codebase, defined in packages/jest-react/src/JestReact.js.
Where is jsonChildrenToJSXChildren() defined?
jsonChildrenToJSXChildren() is defined in packages/jest-react/src/JestReact.js at line 114.
What does jsonChildrenToJSXChildren() call?
jsonChildrenToJSXChildren() calls 1 function(s): jsonChildToJSXChild.
What calls jsonChildrenToJSXChildren()?
jsonChildrenToJSXChildren() is called by 2 function(s): jsonChildToJSXChild, unstable_toMatchRenderedOutput.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free