Home / File/ mouse-move.js — react Source File

mouse-move.js — react Source File

Architecture documentation for mouse-move.js, a javascript file in the react codebase. 4 imports, 1 dependents.

File javascript BabelCompiler Entrypoint 4 imports 1 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  b06995b9_20f4_1e15_2c5f_cd62c995cb8f["mouse-move.js"]
  14dde3c9_48ef_6e34_3667_978d06aff15d["TestCase.js"]
  b06995b9_20f4_1e15_2c5f_cd62c995cb8f --> 14dde3c9_48ef_6e34_3667_978d06aff15d
  e1e356f5_b085_dad5_a81f_4b4844381311["TestCase"]
  b06995b9_20f4_1e15_2c5f_cd62c995cb8f --> e1e356f5_b085_dad5_a81f_4b4844381311
  2f03cb1b_ff7c_7f2b_3a28_70e5f12a2353["hit-box.js"]
  b06995b9_20f4_1e15_2c5f_cd62c995cb8f --> 2f03cb1b_ff7c_7f2b_3a28_70e5f12a2353
  fc9f3f89_2f8e_1981_9a7a_be6e6b016b4d["HitBox"]
  b06995b9_20f4_1e15_2c5f_cd62c995cb8f --> fc9f3f89_2f8e_1981_9a7a_be6e6b016b4d
  f8580ab0_af28_a75c_9c9c_5db8c5f3f5f7["index.js"]
  f8580ab0_af28_a75c_9c9c_5db8c5f3f5f7 --> b06995b9_20f4_1e15_2c5f_cd62c995cb8f
  style b06995b9_20f4_1e15_2c5f_cd62c995cb8f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import TestCase from '../../TestCase';
import HitBox from './hit-box';

const React = window.React;

class MouseMove extends React.Component {
  state = {
    events: [],
  };

  checkEvent = event => {
    let {events} = this.state;

    if (event.type === 'mousemove' && events.indexOf(event) === -1) {
      this.setState({events: events.concat(event)});
    }
  };

  render() {
    const {events} = this.state;

    return (
      <TestCase title="Mouse Move" description="">
        <TestCase.Steps>
          <li>Mouse over the box below</li>
        </TestCase.Steps>

        <TestCase.ExpectedResult>
          Mousemove should share the same instance of the event between
          dispatches.
        </TestCase.ExpectedResult>

        <HitBox onMouseMove={this.checkEvent} />

        <p>
          Was the event pooled?{' '}
          <b>
            {events.length ? (events.length <= 1 ? 'Yes' : 'No') : 'Unsure'} (
            {events.length} events)
          </b>
        </p>
      </TestCase>
    );
  }
}

export default MouseMove;

Domain

Subdomains

Classes

Frequently Asked Questions

What does mouse-move.js do?
mouse-move.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Entrypoint subdomain.
What does mouse-move.js depend on?
mouse-move.js imports 4 module(s): HitBox, TestCase, TestCase.js, hit-box.js.
What files import mouse-move.js?
mouse-move.js is imported by 1 file(s): index.js.
Where is mouse-move.js in the architecture?
mouse-move.js is located at fixtures/dom/src/components/fixtures/event-pooling/mouse-move.js (domain: BabelCompiler, subdomain: Entrypoint, directory: fixtures/dom/src/components/fixtures/event-pooling).

Analyze Your Own Codebase

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

Try Supermodel Free