Home / Function/ CodeEditorOptions() — react Function Reference

CodeEditorOptions() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  09ea2535_a107_bb02_d62f_c47ef5914da8["CodeEditorOptions()"]
  3360bd40_244b_03ad_208a_10c8b4341347["CodeEditorOptions.js"]
  09ea2535_a107_bb02_d62f_c47ef5914da8 -->|defined in| 3360bd40_244b_03ad_208a_10c8b4341347
  style 09ea2535_a107_bb02_d62f_c47ef5914da8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/views/Settings/CodeEditorOptions.js lines 23–61

export default function CodeEditorOptions({
  environmentNames,
}: {
  environmentNames: Promise<Array<string>>,
}): React.Node {
  const [openInEditorURLPreset, setOpenInEditorURLPreset] = useLocalStorage<
    'vscode' | 'custom',
  >(LOCAL_STORAGE_OPEN_IN_EDITOR_URL_PRESET, getDefaultPreset());

  const [openInEditorURL, setOpenInEditorURL] = useLocalStorage<string>(
    LOCAL_STORAGE_OPEN_IN_EDITOR_URL,
    getDefaultOpenInEditorURL(),
  );

  return (
    <>
      <select
        value={openInEditorURLPreset}
        onChange={({currentTarget}) => {
          const selectedValue = currentTarget.value;
          setOpenInEditorURLPreset(selectedValue);
        }}>
        <option value="vscode">VS Code</option>
        <option value="custom">Custom</option>
      </select>
      {openInEditorURLPreset === 'custom' && (
        <input
          className={styles.Input}
          type="text"
          placeholder={getDefaultOpenInEditorURL()}
          value={openInEditorURL}
          onChange={event => {
            setOpenInEditorURL(event.target.value);
          }}
        />
      )}
    </>
  );
}

Domain

Subdomains

Frequently Asked Questions

What does CodeEditorOptions() do?
CodeEditorOptions() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/Settings/CodeEditorOptions.js.
Where is CodeEditorOptions() defined?
CodeEditorOptions() is defined in packages/react-devtools-shared/src/devtools/views/Settings/CodeEditorOptions.js at line 23.

Analyze Your Own Codebase

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

Try Supermodel Free