Home / Function/ smartStringify() — react Function Reference

smartStringify() — react Function Reference

Architecture documentation for the smartStringify() function in utils.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  2020ba72_aecc_bb93_aaf6_bcaa01730dd1["smartStringify()"]
  fa31bba5_57ed_1039_52bb_4a8cb4382642["utils.js"]
  2020ba72_aecc_bb93_aaf6_bcaa01730dd1 -->|defined in| fa31bba5_57ed_1039_52bb_4a8cb4382642
  6a373365_dcc3_7fb5_eb07_8f37a4ad9a9d["useEditableValueReducer()"]
  6a373365_dcc3_7fb5_eb07_8f37a4ad9a9d -->|calls| 2020ba72_aecc_bb93_aaf6_bcaa01730dd1
  style 2020ba72_aecc_bb93_aaf6_bcaa01730dd1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/utils.js lines 241–253

export function smartStringify(value: any): string {
  if (typeof value === 'number') {
    if (Number.isNaN(value)) {
      return 'NaN';
    } else if (!Number.isFinite(value)) {
      return 'Infinity';
    }
  } else if (value === undefined) {
    return 'undefined';
  }

  return JSON.stringify(value);
}

Domain

Subdomains

Frequently Asked Questions

What does smartStringify() do?
smartStringify() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/utils.js.
Where is smartStringify() defined?
smartStringify() is defined in packages/react-devtools-shared/src/devtools/utils.js at line 241.
What calls smartStringify()?
smartStringify() is called by 1 function(s): useEditableValueReducer.

Analyze Your Own Codebase

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

Try Supermodel Free