Home / Class/ Parent Class — react Architecture

Parent Class — react Architecture

Architecture documentation for the Parent class in ReactDOMFiber-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c836abfd_45ba_cd8f_68ba_a9a6f6d79489["Parent"]
  07e91b9c_6954_c576_d406_39f698daf8d8["ReactDOMFiber-test.js"]
  c836abfd_45ba_cd8f_68ba_a9a6f6d79489 -->|defined in| 07e91b9c_6954_c576_d406_39f698daf8d8
  883323b0_427d_012b_1122_3698f7acaaab["componentDidMount()"]
  c836abfd_45ba_cd8f_68ba_a9a6f6d79489 -->|method| 883323b0_427d_012b_1122_3698f7acaaab
  88b2b967_8cfd_7b0e_32f6_266fdf5fa3b2["componentDidUpdate()"]
  c836abfd_45ba_cd8f_68ba_a9a6f6d79489 -->|method| 88b2b967_8cfd_7b0e_32f6_266fdf5fa3b2
  89cc0f56_bb57_9ee9_cfa5_222fa91bc805["componentWillUnmount()"]
  c836abfd_45ba_cd8f_68ba_a9a6f6d79489 -->|method| 89cc0f56_bb57_9ee9_cfa5_222fa91bc805
  ac676428_7dd6_3315_586a_09f5b6f24eac["render()"]
  c836abfd_45ba_cd8f_68ba_a9a6f6d79489 -->|method| ac676428_7dd6_3315_586a_09f5b6f24eac
  79cc94e3_743f_c760_9400_bbc5caa51082["getChildContext()"]
  c836abfd_45ba_cd8f_68ba_a9a6f6d79489 -->|method| 79cc94e3_743f_c760_9400_bbc5caa51082

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactDOMFiber-test.js lines 250–278

    class Parent extends React.Component {
      componentDidMount() {
        Scheduler.log(`Parent:${this.props.step} componentDidMount`);
      }
      componentDidUpdate() {
        Scheduler.log(`Parent:${this.props.step} componentDidUpdate`);
      }
      componentWillUnmount() {
        Scheduler.log(`Parent:${this.props.step} componentWillUnmount`);
      }
      render() {
        const {step} = this.props;
        return [
          <Child key="a" name={`normal[0]:${step}`} />,
          ReactDOM.createPortal(
            <Child key="b" name={`portal1[0]:${step}`} />,
            portalContainer1,
          ),
          <Child key="c" name={`normal[1]:${step}`} />,
          ReactDOM.createPortal(
            [
              <Child key="d" name={`portal2[0]:${step}`} />,
              <Child key="e" name={`portal2[1]:${step}`} />,
            ],
            portalContainer2,
          ),
        ];
      }
    }

Frequently Asked Questions

What is the Parent class?
Parent is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactDOMFiber-test.js.
Where is Parent defined?
Parent is defined in packages/react-dom/src/__tests__/ReactDOMFiber-test.js at line 250.

Analyze Your Own Codebase

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

Try Supermodel Free