Home / Function/ NativeStyleEditor() — react Function Reference

NativeStyleEditor() — react Function Reference

Architecture documentation for the NativeStyleEditor() function in index.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a3738faf_5ea7_bc3f_d602_b154f8029fcb["NativeStyleEditor()"]
  a9cbaa5a_1a08_c395_56b8_61ce5609ff01["index.js"]
  a3738faf_5ea7_bc3f_d602_b154f8029fcb -->|defined in| a9cbaa5a_1a08_c395_56b8_61ce5609ff01
  style a3738faf_5ea7_bc3f_d602_b154f8029fcb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/index.js lines 45–68

function NativeStyleEditor() {
  const {inspectedElementID} = useContext(TreeStateContext);
  const inspectedElementStyleAndLayout = useContext(NativeStyleContext);
  if (inspectedElementID === null) {
    return null;
  }
  if (inspectedElementStyleAndLayout === null) {
    return null;
  }

  const {layout, style} = inspectedElementStyleAndLayout;
  if (layout === null && style === null) {
    return null;
  }

  return (
    <div className={styles.Stack}>
      {layout !== null && (
        <LayoutViewer id={inspectedElementID} layout={layout} />
      )}
      {style !== null && <StyleEditor id={inspectedElementID} style={style} />}
    </div>
  );
}

Domain

Subdomains

Frequently Asked Questions

What does NativeStyleEditor() do?
NativeStyleEditor() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/index.js.
Where is NativeStyleEditor() defined?
NativeStyleEditor() is defined in packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/index.js at line 45.

Analyze Your Own Codebase

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

Try Supermodel Free