Home / File/ RadioGroupFixture.js — react Source File

RadioGroupFixture.js — react Source File

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

Relationship Graph

Source Code

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

class RadioGroupFixture 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 >= 3 ? 'green' : 'red';

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

export default RadioGroupFixture;

Domain

Subdomains

Frequently Asked Questions

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