Home / Function/ setIsStrictModeForDevtools() — react Function Reference

setIsStrictModeForDevtools() — react Function Reference

Architecture documentation for the setIsStrictModeForDevtools() function in ReactFiberDevToolsHook.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  88d91075_df31_e6fc_5535_80030045f42a["setIsStrictModeForDevtools()"]
  1f955e30_ff03_d9f9_d498_58b7dc7858dc["ReactFiberDevToolsHook.js"]
  88d91075_df31_e6fc_5535_80030045f42a -->|defined in| 1f955e30_ff03_d9f9_d498_58b7dc7858dc
  fec6f182_8acb_a259_b114_e6d1db8ac64b["finishClassComponent()"]
  fec6f182_8acb_a259_b114_e6d1db8ac64b -->|calls| 88d91075_df31_e6fc_5535_80030045f42a
  9f4500d1_a30b_b3dc_2405_2ab2117c51e4["applyDerivedStateFromProps()"]
  9f4500d1_a30b_b3dc_2405_2ab2117c51e4 -->|calls| 88d91075_df31_e6fc_5535_80030045f42a
  2b0ae04e_0543_188d_43fc_818335c01e4c["checkShouldComponentUpdate()"]
  2b0ae04e_0543_188d_43fc_818335c01e4c -->|calls| 88d91075_df31_e6fc_5535_80030045f42a
  0557b097_fe16_f352_4804_dd4ff4366808["constructClassInstance()"]
  0557b097_fe16_f352_4804_dd4ff4366808 -->|calls| 88d91075_df31_e6fc_5535_80030045f42a
  style 88d91075_df31_e6fc_5535_80030045f42a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberDevToolsHook.js lines 187–207

export function setIsStrictModeForDevtools(newIsStrictMode: boolean) {
  if (typeof log === 'function') {
    // We're in a test because Scheduler.log only exists
    // in SchedulerMock. To reduce the noise in strict mode tests,
    // suppress warnings and disable scheduler yielding during the double render
    unstable_setDisableYieldValue(newIsStrictMode);
  }

  if (injectedHook && typeof injectedHook.setStrictMode === 'function') {
    try {
      injectedHook.setStrictMode(rendererID, newIsStrictMode);
    } catch (err) {
      if (__DEV__) {
        if (!hasLoggedError) {
          hasLoggedError = true;
          console.error('React instrumentation encountered an error: %o', err);
        }
      }
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does setIsStrictModeForDevtools() do?
setIsStrictModeForDevtools() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberDevToolsHook.js.
Where is setIsStrictModeForDevtools() defined?
setIsStrictModeForDevtools() is defined in packages/react-reconciler/src/ReactFiberDevToolsHook.js at line 187.
What calls setIsStrictModeForDevtools()?
setIsStrictModeForDevtools() is called by 4 function(s): applyDerivedStateFromProps, checkShouldComponentUpdate, constructClassInstance, finishClassComponent.

Analyze Your Own Codebase

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

Try Supermodel Free