Home / Function/ setValueForKnownAttribute() — react Function Reference

setValueForKnownAttribute() — react Function Reference

Architecture documentation for the setValueForKnownAttribute() function in DOMPropertyOperations.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ff83d1d6_04b2_f2c3_24b2_6ffa36a99dd8["setValueForKnownAttribute()"]
  390123a6_56c3_29ed_a331_44deb86078d6["DOMPropertyOperations.js"]
  ff83d1d6_04b2_f2c3_24b2_6ffa36a99dd8 -->|defined in| 390123a6_56c3_29ed_a331_44deb86078d6
  5a792874_dbaf_1dd0_9e62_d6a16580e0b5["setProp()"]
  5a792874_dbaf_1dd0_9e62_d6a16580e0b5 -->|calls| ff83d1d6_04b2_f2c3_24b2_6ffa36a99dd8
  style ff83d1d6_04b2_f2c3_24b2_6ffa36a99dd8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/client/DOMPropertyOperations.js lines 134–159

export function setValueForKnownAttribute(
  node: Element,
  name: string,
  value: mixed,
) {
  if (value === null) {
    node.removeAttribute(name);
    return;
  }
  switch (typeof value) {
    case 'undefined':
    case 'function':
    case 'symbol':
    case 'boolean': {
      node.removeAttribute(name);
      return;
    }
  }
  if (__DEV__) {
    checkAttributeStringCoercion(value, name);
  }
  node.setAttribute(
    name,
    enableTrustedTypesIntegration ? (value: any) : '' + (value: any),
  );
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does setValueForKnownAttribute() do?
setValueForKnownAttribute() is a function in the react codebase, defined in packages/react-dom-bindings/src/client/DOMPropertyOperations.js.
Where is setValueForKnownAttribute() defined?
setValueForKnownAttribute() is defined in packages/react-dom-bindings/src/client/DOMPropertyOperations.js at line 134.
What calls setValueForKnownAttribute()?
setValueForKnownAttribute() is called by 1 function(s): setProp.

Analyze Your Own Codebase

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

Try Supermodel Free