CodeEditorOptions.js — react Source File
Architecture documentation for CodeEditorOptions.js, a javascript file in the react codebase. 5 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR 3360bd40_244b_03ad_208a_10c8b4341347["CodeEditorOptions.js"] bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f["constants.js"] 3360bd40_244b_03ad_208a_10c8b4341347 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f 315baf50_1028_51ca_a9c1_679c6a17ed98["hooks.js"] 3360bd40_244b_03ad_208a_10c8b4341347 --> 315baf50_1028_51ca_a9c1_679c6a17ed98 3c0f989f_424c_e338_72c3_e8bc259ca04f["SettingsShared.css"] 3360bd40_244b_03ad_208a_10c8b4341347 --> 3c0f989f_424c_e338_72c3_e8bc259ca04f ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] 3360bd40_244b_03ad_208a_10c8b4341347 --> ac587885_e294_a1e9_b13f_5e7b920fdb42 627bb742_21aa_b4fd_fe2d_4a963a1f9278["utils"] 3360bd40_244b_03ad_208a_10c8b4341347 --> 627bb742_21aa_b4fd_fe2d_4a963a1f9278 4e037c1a_e2a6_57d5_f84d_9c399385f234["EditorSettings.js"] 4e037c1a_e2a6_57d5_f84d_9c399385f234 --> 3360bd40_244b_03ad_208a_10c8b4341347 ba1321bc_42b8_c6c2_e944_8928bf07c59a["GeneralSettings.js"] ba1321bc_42b8_c6c2_e944_8928bf07c59a --> 3360bd40_244b_03ad_208a_10c8b4341347 style 3360bd40_244b_03ad_208a_10c8b4341347 fill:#6366f1,stroke:#818cf8,color:#fff
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
*/
import * as React from 'react';
import {
LOCAL_STORAGE_OPEN_IN_EDITOR_URL,
LOCAL_STORAGE_OPEN_IN_EDITOR_URL_PRESET,
} from '../../../constants';
import {useLocalStorage} from '../hooks';
import {
getDefaultPreset,
getDefaultOpenInEditorURL,
} from 'react-devtools-shared/src/utils';
import styles from './SettingsShared.css';
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
Functions
Dependencies
- SettingsShared.css
- constants.js
- hooks.js
- react
- utils
Imported By
Source
Frequently Asked Questions
What does CodeEditorOptions.js do?
CodeEditorOptions.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 CodeEditorOptions.js?
CodeEditorOptions.js defines 1 function(s): CodeEditorOptions.
What does CodeEditorOptions.js depend on?
CodeEditorOptions.js imports 5 module(s): SettingsShared.css, constants.js, hooks.js, react, utils.
What files import CodeEditorOptions.js?
CodeEditorOptions.js is imported by 2 file(s): EditorSettings.js, GeneralSettings.js.
Where is CodeEditorOptions.js in the architecture?
CodeEditorOptions.js is located at packages/react-devtools-shared/src/devtools/views/Settings/CodeEditorOptions.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/devtools/views/Settings).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free