Home / Class/ FixturesPage Class — react Architecture

FixturesPage Class — react Architecture

Architecture documentation for the FixturesPage class in index.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8f0ba8c8_deae_17e1_f7bf_55872c3d51c2["FixturesPage"]
  9fdca11b_70ed_a288_1347_ba7a20f86c41["index.js"]
  8f0ba8c8_deae_17e1_f7bf_55872c3d51c2 -->|defined in| 9fdca11b_70ed_a288_1347_ba7a20f86c41
  d0e8df74_c67e_4c01_7d42_47f8e8666f37["componentDidMount()"]
  8f0ba8c8_deae_17e1_f7bf_55872c3d51c2 -->|method| d0e8df74_c67e_4c01_7d42_47f8e8666f37
  06e93cf1_c7ae_98f2_9c9a_5480084c3dac["loadFixture()"]
  8f0ba8c8_deae_17e1_f7bf_55872c3d51c2 -->|method| 06e93cf1_c7ae_98f2_9c9a_5480084c3dac
  b123bf88_e9ca_8e23_33d8_930deffed8b9["render()"]
  8f0ba8c8_deae_17e1_f7bf_55872c3d51c2 -->|method| b123bf88_e9ca_8e23_33d8_930deffed8b9

Relationship Graph

Source Code

fixtures/dom/src/components/fixtures/index.js lines 8–51

class FixturesPage extends React.Component {
  static defaultProps = {
    fixturePath: fixturePath === '/' ? '/home' : fixturePath,
  };

  state = {
    isLoading: true,
    error: null,
    Fixture: null,
  };

  componentDidMount() {
    this.loadFixture();
  }

  async loadFixture() {
    const {fixturePath} = this.props;

    try {
      const module = await import(`.${fixturePath}`);

      this.setState({Fixture: module.default});
    } catch (error) {
      console.error(error);
      this.setState({error});
    } finally {
      this.setState({isLoading: false});
    }
  }

  render() {
    const {Fixture, error, isLoading} = this.state;

    if (isLoading) {
      return null;
    }

    if (error) {
      return <FixtureError error={error} />;
    }

    return <Fixture />;
  }
}

Domain

Frequently Asked Questions

What is the FixturesPage class?
FixturesPage is a class in the react codebase, defined in fixtures/dom/src/components/fixtures/index.js.
Where is FixturesPage defined?
FixturesPage is defined in fixtures/dom/src/components/fixtures/index.js at line 8.

Analyze Your Own Codebase

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

Try Supermodel Free