Home / Function/ KeyboardEventInterface.charCode() — react Function Reference

KeyboardEventInterface.charCode() — react Function Reference

Architecture documentation for the KeyboardEventInterface.charCode() function in SyntheticEvent.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  6a3a9c3b_4eb3_bef7_3729_e4c168fb39b7["KeyboardEventInterface.charCode()"]
  9c3d71d9_41af_c5e7_cd35_d25bbf6cf606["SyntheticEvent.js"]
  6a3a9c3b_4eb3_bef7_3729_e4c168fb39b7 -->|defined in| 9c3d71d9_41af_c5e7_cd35_d25bbf6cf606
  e465f930_ff45_eb24_125c_d4942d1fa85f["getEventCharCode()"]
  6a3a9c3b_4eb3_bef7_3729_e4c168fb39b7 -->|calls| e465f930_ff45_eb24_125c_d4942d1fa85f
  style 6a3a9c3b_4eb3_bef7_3729_e4c168fb39b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/events/SyntheticEvent.js lines 458–471

  charCode: function (event: {[propName: string]: mixed}) {
    // `charCode` is the result of a KeyPress event and represents the value of
    // the actual printable character.

    // KeyPress is deprecated, but its replacement is not yet final and not
    // implemented in any major browser. Only KeyPress has charCode.
    if (event.type === 'keypress') {
      return getEventCharCode(
        // $FlowFixMe[incompatible-call] unable to narrow to `KeyboardEvent`
        event,
      );
    }
    return 0;
  },

Domain

Subdomains

Frequently Asked Questions

What does KeyboardEventInterface.charCode() do?
KeyboardEventInterface.charCode() is a function in the react codebase, defined in packages/react-dom-bindings/src/events/SyntheticEvent.js.
Where is KeyboardEventInterface.charCode() defined?
KeyboardEventInterface.charCode() is defined in packages/react-dom-bindings/src/events/SyntheticEvent.js at line 458.
What does KeyboardEventInterface.charCode() call?
KeyboardEventInterface.charCode() calls 1 function(s): getEventCharCode.

Analyze Your Own Codebase

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

Try Supermodel Free