Home / File/ repro-cx-assigned-to-temporary.js — react Source File

repro-cx-assigned-to-temporary.js — react Source File

Architecture documentation for repro-cx-assigned-to-temporary.js, a javascript file in the react codebase. 1 imports, 0 dependents.

File javascript TestingUtilities Fixtures 1 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  16802089_c6c8_593f_6c7b_1fde4f6451dd["repro-cx-assigned-to-temporary.js"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  16802089_c6c8_593f_6c7b_1fde4f6451dd --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 16802089_c6c8_593f_6c7b_1fde4f6451dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @compilationMode:"infer" @enableAssumeHooksFollowRulesOfReact:false @customMacros:"cx"
import {identity} from 'shared-runtime';

const DARK = 'dark';

function Component() {
  const theme = useTheme();
  return (
    <div
      className={cx({
        'styles/light': true,
        'styles/dark': theme.getTheme() === DARK,
      })}
    />
  );
}

function cx(obj) {
  const classes = [];
  for (const [key, value] of Object.entries(obj)) {
    if (value) {
      classes.push(key);
    }
  }
  return classes.join(' ');
}

function useTheme() {
  return {
    getTheme() {
      return DARK;
    },
  };
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{}],
};

Subdomains

Dependencies

  • shared-runtime

Frequently Asked Questions

What does repro-cx-assigned-to-temporary.js do?
repro-cx-assigned-to-temporary.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in repro-cx-assigned-to-temporary.js?
repro-cx-assigned-to-temporary.js defines 3 function(s): Component, cx, useTheme.
What does repro-cx-assigned-to-temporary.js depend on?
repro-cx-assigned-to-temporary.js imports 1 module(s): shared-runtime.
Where is repro-cx-assigned-to-temporary.js in the architecture?
repro-cx-assigned-to-temporary.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/meta-isms/repro-cx-assigned-to-temporary.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/meta-isms).

Analyze Your Own Codebase

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

Try Supermodel Free