Home / Class/ Switcher Class — react Architecture

Switcher Class — react Architecture

Architecture documentation for the Switcher class in ReactUpdates-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8f683ded_6a96_e7d4_1dc6_f651960db41d["Switcher"]
  e1a7562e_ea2b_594b_d7d2_0ca836dcd888["ReactUpdates-test.js"]
  8f683ded_6a96_e7d4_1dc6_f651960db41d -->|defined in| e1a7562e_ea2b_594b_d7d2_0ca836dcd888
  dd801810_c241_504c_9a5d_2cfaa6a3c3e4["render()"]
  8f683ded_6a96_e7d4_1dc6_f651960db41d -->|method| dd801810_c241_504c_9a5d_2cfaa6a3c3e4

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactUpdates-test.js lines 554–573

    class Switcher extends React.Component {
      state = {tabKey: 'hello'};
      boxRef = React.createRef();
      switcherDivRef = React.createRef();
      render() {
        const child = this.props.children;

        return (
          <Box ref={this.boxRef}>
            <div
              ref={this.switcherDivRef}
              style={{
                display: this.state.tabKey === child.key ? '' : 'none',
              }}>
              {child}
            </div>
          </Box>
        );
      }
    }

Frequently Asked Questions

What is the Switcher class?
Switcher is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactUpdates-test.js.
Where is Switcher defined?
Switcher is defined in packages/react-dom/src/__tests__/ReactUpdates-test.js at line 554.

Analyze Your Own Codebase

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

Try Supermodel Free