Home / Class/ GrandChild Class — react Architecture

GrandChild Class — react Architecture

Architecture documentation for the GrandChild class in ReactLegacyCompositeComponent-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  be9c55e8_d846_4cb7_3e36_37181e722927["GrandChild"]
  3b351a1f_faad_fff4_44c6_33b8718b45d0["ReactLegacyCompositeComponent-test.js"]
  be9c55e8_d846_4cb7_3e36_37181e722927 -->|defined in| 3b351a1f_faad_fff4_44c6_33b8718b45d0
  4a9cec62_e190_4988_d5c9_262fa740c4f9["UNSAFE_componentWillReceiveProps()"]
  be9c55e8_d846_4cb7_3e36_37181e722927 -->|method| 4a9cec62_e190_4988_d5c9_262fa740c4f9
  91813a41_f6a4_4268_8313_1ca1a08c1e8d["render()"]
  be9c55e8_d846_4cb7_3e36_37181e722927 -->|method| 91813a41_f6a4_4268_8313_1ca1a08c1e8d

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactLegacyCompositeComponent-test.js lines 516–536

    class GrandChild extends React.Component {
      static contextTypes = {
        foo: PropTypes.string.isRequired,
      };

      UNSAFE_componentWillReceiveProps(nextProps, nextContext) {
        expect('foo' in nextContext).toBe(true);

        if (nextProps !== this.props) {
          propChanges++;
        }

        if (nextContext !== this.context) {
          contextChanges++;
        }
      }

      render() {
        return <span className="grand-child">{this.props.children}</span>;
      }
    }

Frequently Asked Questions

What is the GrandChild class?
GrandChild is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactLegacyCompositeComponent-test.js.
Where is GrandChild defined?
GrandChild is defined in packages/react-dom/src/__tests__/ReactLegacyCompositeComponent-test.js at line 516.

Analyze Your Own Codebase

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

Try Supermodel Free