Home / File/ ReactClientDebugConfigBrowser.js — react Source File

ReactClientDebugConfigBrowser.js — react Source File

Architecture documentation for ReactClientDebugConfigBrowser.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

let hasConfirmedEval = false;
export function checkEvalAvailabilityOnceDev(): void {
  if (__DEV__) {
    if (!hasConfirmedEval) {
      hasConfirmedEval = true;
      try {
        // eslint-disable-next-line no-eval
        (0, eval)('null');
      } catch {
        console.error(
          'eval() is not supported in this environment. ' +
            'If this page was served with a `Content-Security-Policy` header, ' +
            'make sure that `unsafe-eval` is included. ' +
            'React requires eval() in development mode for various debugging features ' +
            'like reconstructing callstacks from a different environment.\n' +
            'React will never use eval() in production mode',
        );
      }
    }
  } else {
    // These errors should never make it into a build so we don't need to encode them in codes.json
    // eslint-disable-next-line react-internal/prod-error-codes
    throw new Error(
      'checkEvalAvailabilityOnceDev should never be called in production mode. This is a bug in React.',
    );
  }
}

Domain

Subdomains

Frequently Asked Questions

What does ReactClientDebugConfigBrowser.js do?
ReactClientDebugConfigBrowser.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ReactClientDebugConfigBrowser.js?
ReactClientDebugConfigBrowser.js defines 1 function(s): checkEvalAvailabilityOnceDev.
Where is ReactClientDebugConfigBrowser.js in the architecture?
ReactClientDebugConfigBrowser.js is located at packages/react-client/src/ReactClientDebugConfigBrowser.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-client/src).

Analyze Your Own Codebase

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

Try Supermodel Free