Home / File/ hover.js — react Source File

hover.js — react Source File

Architecture documentation for hover.js, a javascript file in the react codebase. 3 imports, 1 dependents.

File javascript BabelCompiler Optimization 3 imports 1 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  2ca2eb4e_6de0_5f62_cf94_d2d19df563a9["hover.js"]
  14dde3c9_48ef_6e34_3667_978d06aff15d["TestCase.js"]
  2ca2eb4e_6de0_5f62_cf94_d2d19df563a9 --> 14dde3c9_48ef_6e34_3667_978d06aff15d
  e1e356f5_b085_dad5_a81f_4b4844381311["TestCase"]
  2ca2eb4e_6de0_5f62_cf94_d2d19df563a9 --> e1e356f5_b085_dad5_a81f_4b4844381311
  f3324925_dc09_1a9b_424a_455190eb7f99["hover-box.js"]
  2ca2eb4e_6de0_5f62_cf94_d2d19df563a9 --> f3324925_dc09_1a9b_424a_455190eb7f99
  6916a448_5f93_bcc1_7bbd_d004d54840e9["index.js"]
  6916a448_5f93_bcc1_7bbd_d004d54840e9 --> 2ca2eb4e_6de0_5f62_cf94_d2d19df563a9
  style 2ca2eb4e_6de0_5f62_cf94_d2d19df563a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import TestCase from '../../TestCase';
import HoverBox from './hover-box';

const React = window.React;

class Hover extends React.Component {
  state = {
    overs: 0,
    outs: 0,
    enters: 0,
    leaves: 0,
  };

  onOver = () => this.setState({overs: this.state.overs + 1});
  onOut = () => this.setState({outs: this.state.outs + 1});
  onEnter = () => this.setState({enters: this.state.enters + 1});
  onLeave = () => this.setState({leaves: this.state.leaves + 1});

  render() {
    const {overs, outs, enters, leaves} = this.state;

    return (
      <TestCase title="Hover" description="">
        <TestCase.Steps>
          <li>Hover over the above box and the obstacles</li>
        </TestCase.Steps>

        <TestCase.ExpectedResult>
          Overs and outs should increase when moving over the obstacles but
          enters and leaves should not.
        </TestCase.ExpectedResult>

        <HoverBox
          onOver={this.onOver}
          onOut={this.onOut}
          onEnter={this.onEnter}
          onLeave={this.onLeave}
        />

        <p>
          Pointer Overs: <b>{overs}</b> <br />
          Pointer Outs: <b>{outs}</b> <br />
          Pointer Enters: <b>{enters}</b> <br />
          Pointer Leaves: <b>{leaves}</b> <br />
        </p>
      </TestCase>
    );
  }
}

export default Hover;

Domain

Subdomains

Classes

Frequently Asked Questions

What does hover.js do?
hover.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What does hover.js depend on?
hover.js imports 3 module(s): TestCase, TestCase.js, hover-box.js.
What files import hover.js?
hover.js is imported by 1 file(s): index.js.
Where is hover.js in the architecture?
hover.js is located at fixtures/dom/src/components/fixtures/pointer-events/hover.js (domain: BabelCompiler, subdomain: Optimization, directory: fixtures/dom/src/components/fixtures/pointer-events).

Analyze Your Own Codebase

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

Try Supermodel Free