Home / Function/ getReactNativeFeatureFlagsMajor() — react Function Reference

getReactNativeFeatureFlagsMajor() — react Function Reference

Architecture documentation for the getReactNativeFeatureFlagsMajor() function in flags.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4a539ce3_4bcb_62ea_26fd_53dae1f25fec["getReactNativeFeatureFlagsMajor()"]
  9707085b_16d7_ffa5_8026_16a476a1a065["flags.js"]
  4a539ce3_4bcb_62ea_26fd_53dae1f25fec -->|defined in| 9707085b_16d7_ffa5_8026_16a476a1a065
  style 4a539ce3_4bcb_62ea_26fd_53dae1f25fec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/flags/flags.js lines 108–139

function getReactNativeFeatureFlagsMajor() {
  const virtualName = 'ReactNativeFeatureFlagsMajor.js';
  const file = fs.readFileSync(
    path.join(
      __dirname,
      '../../packages/shared/forks/ReactFeatureFlags.native-oss.js'
    ),
    'utf8'
  );
  const fileContent = transformSync(
    file
      .replace(
        'const __NEXT_RN_MAJOR__ = true;',
        'const __NEXT_RN_MAJOR__ = "next";'
      )
      .replace(
        'const __TODO_NEXT_RN_MAJOR__ = false;',
        'const __TODO_NEXT_RN_MAJOR__ = "next-todo";'
      ),
    {
      plugins: ['@babel/plugin-transform-modules-commonjs'],
    }
  ).code;

  const parent = module.parent;
  const m = new Module(virtualName, parent);
  m.filename = virtualName;

  m._compile(fileContent, virtualName);

  return m.exports;
}

Domain

Subdomains

Frequently Asked Questions

What does getReactNativeFeatureFlagsMajor() do?
getReactNativeFeatureFlagsMajor() is a function in the react codebase, defined in scripts/flags/flags.js.
Where is getReactNativeFeatureFlagsMajor() defined?
getReactNativeFeatureFlagsMajor() is defined in scripts/flags/flags.js at line 108.

Analyze Your Own Codebase

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

Try Supermodel Free