Home / Class/ GetEventTypeDuringUpdate Class — react Architecture

GetEventTypeDuringUpdate Class — react Architecture

Architecture documentation for the GetEventTypeDuringUpdate class in index.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  5c30de97_6a59_be2a_c9cb_bf4cb1c432af["GetEventTypeDuringUpdate"]
  81bda781_d1ab_04a2_f9a5_679111cfc7c2["index.js"]
  5c30de97_6a59_be2a_c9cb_bf4cb1c432af -->|defined in| 81bda781_d1ab_04a2_f9a5_679111cfc7c2
  d7e69626_bcee_efa4_90f5_9fa19608f4d4["componentDidUpdate()"]
  5c30de97_6a59_be2a_c9cb_bf4cb1c432af -->|method| d7e69626_bcee_efa4_90f5_9fa19608f4d4
  fe977887_d2ad_933d_63ba_f7acc06d4542["render()"]
  5c30de97_6a59_be2a_c9cb_bf4cb1c432af -->|method| fe977887_d2ad_933d_63ba_f7acc06d4542

Relationship Graph

Source Code

fixtures/dom/src/components/fixtures/error-handling/index.js lines 155–192

class GetEventTypeDuringUpdate extends React.Component {
  state = {};

  onClick = () => {
    this.expectUpdate = true;
    this.forceUpdate();
  };

  componentDidUpdate() {
    if (this.expectUpdate) {
      this.expectUpdate = false;
      this.setState({eventType: window.event.type});
      setTimeout(() => {
        this.setState({cleared: !window.event});
      });
    }
  }

  render() {
    return (
      <div className="test-fixture">
        <button onClick={this.onClick}>Trigger callback in event.</button>
        {this.state.eventType ? (
          <p>
            Got <b>{this.state.eventType}</b> event.
          </p>
        ) : (
          <p>Got no event</p>
        )}
        {this.state.cleared ? (
          <p>Event cleared correctly.</p>
        ) : (
          <p>Event failed to clear.</p>
        )}
      </div>
    );
  }
}

Domain

Frequently Asked Questions

What is the GetEventTypeDuringUpdate class?
GetEventTypeDuringUpdate is a class in the react codebase, defined in fixtures/dom/src/components/fixtures/error-handling/index.js.
Where is GetEventTypeDuringUpdate defined?
GetEventTypeDuringUpdate is defined in fixtures/dom/src/components/fixtures/error-handling/index.js at line 155.

Analyze Your Own Codebase

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

Try Supermodel Free