Home / Function/ identityHashFn() — react Function Reference

identityHashFn() — react Function Reference

Architecture documentation for the identityHashFn() function in ReactCacheOld.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4a774c06_1b3c_4cf9_9739_362f2476a35f["identityHashFn()"]
  8ab83c6a_7f7f_de7c_f120_e86a1c481f9e["ReactCacheOld.js"]
  4a774c06_1b3c_4cf9_9739_362f2476a35f -->|defined in| 8ab83c6a_7f7f_de7c_f120_e86a1c481f9e
  style 4a774c06_1b3c_4cf9_9739_362f2476a35f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-cache/src/ReactCacheOld.js lines 65–84

function identityHashFn(input) {
  if (__DEV__) {
    if (
      typeof input !== 'string' &&
      typeof input !== 'number' &&
      typeof input !== 'boolean' &&
      input !== undefined &&
      input !== null
    ) {
      console.error(
        'Invalid key type. Expected a string, number, symbol, or boolean, ' +
          'but instead received: %s' +
          '\n\nTo use non-primitive values as keys, you must pass a hash ' +
          'function as the second argument to createResource().',
        input,
      );
    }
  }
  return input;
}

Domain

Subdomains

Frequently Asked Questions

What does identityHashFn() do?
identityHashFn() is a function in the react codebase, defined in packages/react-cache/src/ReactCacheOld.js.
Where is identityHashFn() defined?
identityHashFn() is defined in packages/react-cache/src/ReactCacheOld.js at line 65.

Analyze Your Own Codebase

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

Try Supermodel Free