Home / Function/ UNSAFE_componentWillMount() — react Function Reference

UNSAFE_componentWillMount() — react Function Reference

Architecture documentation for the UNSAFE_componentWillMount() function in ReactCompositeComponentState-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d6337c99_334a_c412_d358_040ed18018f1["UNSAFE_componentWillMount()"]
  6a41ba62_6b34_6d3b_c13f_94f3b31fbc8c["Test"]
  d6337c99_334a_c412_d358_040ed18018f1 -->|defined in| 6a41ba62_6b34_6d3b_c13f_94f3b31fbc8c
  style d6337c99_334a_c412_d358_040ed18018f1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js lines 500–510

      UNSAFE_componentWillMount() {
        this.setState({step: 2}, () => {
          // Tests that earlier setState callbacks are not dropped
          Scheduler.log(
            `callback -- step: ${this.state.step}, extra: ${!!this.state
              .extra}`,
          );
        });
        // Treat like replaceState
        this.state = {step: 3};
      }

Domain

Subdomains

Frequently Asked Questions

What does UNSAFE_componentWillMount() do?
UNSAFE_componentWillMount() is a function in the react codebase, defined in packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js.
Where is UNSAFE_componentWillMount() defined?
UNSAFE_componentWillMount() is defined in packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js at line 500.

Analyze Your Own Codebase

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

Try Supermodel Free