Home / File/ RadioClickFixture.js — react Source File

RadioClickFixture.js — react Source File

Architecture documentation for RadioClickFixture.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
  d3372e4a_5372_b44a_3f0e_f4c4bc86caf9["RadioClickFixture.js"]
  bc8ae172_cc20_3692_943c_bbdb1ad34855["Fixture.js"]
  d3372e4a_5372_b44a_3f0e_f4c4bc86caf9 --> bc8ae172_cc20_3692_943c_bbdb1ad34855
  2851624d_a736_f3f6_2132_5a20630983fe["Fixture"]
  d3372e4a_5372_b44a_3f0e_f4c4bc86caf9 --> 2851624d_a736_f3f6_2132_5a20630983fe
  a3aeab4c_4f93_b8d8_01c2_7a351a28a3fb["Fixture"]
  d3372e4a_5372_b44a_3f0e_f4c4bc86caf9 --> a3aeab4c_4f93_b8d8_01c2_7a351a28a3fb
  ba53c75f_b711_f8f4_9a77_b020529fa33b["index.js"]
  ba53c75f_b711_f8f4_9a77_b020529fa33b --> d3372e4a_5372_b44a_3f0e_f4c4bc86caf9
  style d3372e4a_5372_b44a_3f0e_f4c4bc86caf9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Fixture from '../../Fixture';
const React = window.React;

class RadioClickFixture extends React.Component {
  constructor(props, context) {
    super(props, context);

    this.state = {
      changeCount: 0,
    };
  }

  handleChange = () => {
    this.setState(({changeCount}) => {
      return {
        changeCount: changeCount + 1,
      };
    });
  };

  handleReset = () => {
    this.setState({
      changeCount: 0,
    });
  };

  render() {
    const {changeCount} = this.state;
    const color = changeCount === 0 ? 'green' : 'red';

    return (
      <Fixture>
        <label>
          <input defaultChecked type="radio" onChange={this.handleChange} />
          Test case radio input
        </label>{' '}
        <p style={{color}}>
          <code>onChange</code>
          {' calls: '}
          <strong>{changeCount}</strong>
        </p>
        <button onClick={this.handleReset}>Reset count</button>
      </Fixture>
    );
  }
}

export default RadioClickFixture;

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free