Home / Class/ Parent Class — react Architecture

Parent Class — react Architecture

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

Entity Profile

Dependency Diagram

graph TD
  8258d727_0172_75ec_3b40_eb0e296ed803["Parent"]
  950d36df_0c19_b066_edb3_d5746834b718["useSubscription-test.js"]
  8258d727_0172_75ec_3b40_eb0e296ed803 -->|defined in| 950d36df_0c19_b066_edb3_d5746834b718
  72ef7e30_362d_ed6c_259e_cc84cb6abcc4["getDerivedStateFromProps()"]
  8258d727_0172_75ec_3b40_eb0e296ed803 -->|method| 72ef7e30_362d_ed6c_259e_cc84cb6abcc4
  f8dadabd_8717_8400_97ac_f8f28c9a8157["componentDidMount()"]
  8258d727_0172_75ec_3b40_eb0e296ed803 -->|method| f8dadabd_8717_8400_97ac_f8f28c9a8157
  0a3d343d_14ad_d526_a5fe_8e0ad2e2f105["componentDidUpdate()"]
  8258d727_0172_75ec_3b40_eb0e296ed803 -->|method| 0a3d343d_14ad_d526_a5fe_8e0ad2e2f105
  d22e613f_770e_4bfd_b317_9b45f1040d58["render()"]
  8258d727_0172_75ec_3b40_eb0e296ed803 -->|method| d22e613f_770e_4bfd_b317_9b45f1040d58

Relationship Graph

Source Code

packages/use-subscription/src/__tests__/useSubscription-test.js lines 292–316

    class Parent extends React.Component {
      state = {};

      static getDerivedStateFromProps(nextProps, prevState) {
        if (nextProps.observed !== prevState.observed) {
          return {
            observed: nextProps.observed,
          };
        }

        return null;
      }

      componentDidMount() {
        log.push('Parent.componentDidMount');
      }

      componentDidUpdate() {
        log.push('Parent.componentDidUpdate');
      }

      render() {
        return <Subscription source={this.state.observed} />;
      }
    }

Frequently Asked Questions

What is the Parent class?
Parent is a class in the react codebase, defined in packages/use-subscription/src/__tests__/useSubscription-test.js.
Where is Parent defined?
Parent is defined in packages/use-subscription/src/__tests__/useSubscription-test.js at line 292.

Analyze Your Own Codebase

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

Try Supermodel Free