Home / Class/ RadioClickFixture Class — react Architecture

RadioClickFixture Class — react Architecture

Architecture documentation for the RadioClickFixture class in RadioClickFixture.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  fec0ae1e_47a2_84da_b4c8_f28b0c784f3a["RadioClickFixture"]
  d3372e4a_5372_b44a_3f0e_f4c4bc86caf9["RadioClickFixture.js"]
  fec0ae1e_47a2_84da_b4c8_f28b0c784f3a -->|defined in| d3372e4a_5372_b44a_3f0e_f4c4bc86caf9
  b84c5574_237d_11e5_a12e_36ee5aa0b217["constructor()"]
  fec0ae1e_47a2_84da_b4c8_f28b0c784f3a -->|method| b84c5574_237d_11e5_a12e_36ee5aa0b217
  57200aa3_ec2b_10ff_d05d_8c9df69a92d0["render()"]
  fec0ae1e_47a2_84da_b4c8_f28b0c784f3a -->|method| 57200aa3_ec2b_10ff_d05d_8c9df69a92d0

Relationship Graph

Source Code

fixtures/dom/src/components/fixtures/input-change-events/RadioClickFixture.js lines 4–46

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>
    );
  }
}

Domain

Frequently Asked Questions

What is the RadioClickFixture class?
RadioClickFixture is a class in the react codebase, defined in fixtures/dom/src/components/fixtures/input-change-events/RadioClickFixture.js.
Where is RadioClickFixture defined?
RadioClickFixture is defined in fixtures/dom/src/components/fixtures/input-change-events/RadioClickFixture.js at line 4.

Analyze Your Own Codebase

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

Try Supermodel Free