Home / Function/ evalStringConcat() — react Function Reference

evalStringConcat() — react Function Reference

Architecture documentation for the evalStringConcat() function in evalToString.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  f8a28505_2f2a_aa22_96a9_ceafea21c3b9["evalStringConcat()"]
  87f81810_3f4f_a028_8989_01251185890b["evalToString.js"]
  f8a28505_2f2a_aa22_96a9_ceafea21c3b9 -->|defined in| 87f81810_3f4f_a028_8989_01251185890b
  style f8a28505_2f2a_aa22_96a9_ceafea21c3b9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/shared/evalToString.js lines 9–22

function evalStringConcat(ast) {
  switch (ast.type) {
    case 'StringLiteral':
    case 'Literal': // ESLint
      return ast.value;
    case 'BinaryExpression': // `+`
      if (ast.operator !== '+') {
        throw new Error('Unsupported binary operator ' + ast.operator);
      }
      return evalStringConcat(ast.left) + evalStringConcat(ast.right);
    default:
      throw new Error('Unsupported type ' + ast.type);
  }
}

Domain

Subdomains

Frequently Asked Questions

What does evalStringConcat() do?
evalStringConcat() is a function in the react codebase, defined in scripts/shared/evalToString.js.
Where is evalStringConcat() defined?
evalStringConcat() is defined in scripts/shared/evalToString.js at line 9.

Analyze Your Own Codebase

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

Try Supermodel Free