Home / Function/ useEditorURL() — react Function Reference

useEditorURL() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  19776675_fb50_d3e9_2e67_e3dcc7805e1e["useEditorURL()"]
  92c8d128_26b7_05c1_1f27_a9a5ab236fc6["useEditorURL.js"]
  19776675_fb50_d3e9_2e67_e3dcc7805e1e -->|defined in| 92c8d128_26b7_05c1_1f27_a9a5ab236fc6
  07c306bf_14f4_0687_f161_c16874f999aa["InspectedElementWrapper()"]
  07c306bf_14f4_0687_f161_c16874f999aa -->|calls| 19776675_fb50_d3e9_2e67_e3dcc7805e1e
  176a72fa_ccf9_6b77_cd18_6adab3402c52["EditorPane()"]
  176a72fa_ccf9_6b77_cd18_6adab3402c52 -->|calls| 19776675_fb50_d3e9_2e67_e3dcc7805e1e
  style 19776675_fb50_d3e9_2e67_e3dcc7805e1e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/views/useEditorURL.js lines 18–37

const useEditorURL = (): string => {
  const editorURL = useSyncExternalStore(
    useCallback(function subscribe(callback) {
      window.addEventListener(LOCAL_STORAGE_OPEN_IN_EDITOR_URL, callback);
      window.addEventListener(
        LOCAL_STORAGE_OPEN_IN_EDITOR_URL_PRESET,
        callback,
      );
      return function unsubscribe() {
        window.removeEventListener(LOCAL_STORAGE_OPEN_IN_EDITOR_URL, callback);
        window.removeEventListener(
          LOCAL_STORAGE_OPEN_IN_EDITOR_URL_PRESET,
          callback,
        );
      };
    }, []),
    getOpenInEditorURL,
  );
  return editorURL;
};

Domain

Subdomains

Frequently Asked Questions

What does useEditorURL() do?
useEditorURL() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/useEditorURL.js.
Where is useEditorURL() defined?
useEditorURL() is defined in packages/react-devtools-shared/src/devtools/views/useEditorURL.js at line 18.
What calls useEditorURL()?
useEditorURL() is called by 2 function(s): EditorPane, InspectedElementWrapper.

Analyze Your Own Codebase

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

Try Supermodel Free