MCPcopy Index your code
hub / github.com/GrapesJS/react / useEditorInstance

Function useEditorInstance

packages/grapesjs-react/src/context/EditorInstance.tsx:24–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22 * Context used to keep the editor instance once initialized
23 */
24export const useEditorInstance = () => {
25 const context = useContext(EditorInstanceContext);
26
27 if (!context) {
28 throw new Error('useEditorInstance must be used within EditorInstanceProvider');
29 }
30
31 return context;
32};
33
34/**
35 * Get the current editor instance.

Callers 12

LayersProvider.tsxFile · 0.90
AssetsProvider.tsxFile · 0.90
ModalProvider.tsxFile · 0.90
PagesProvider.tsxFile · 0.90
StylesProvider.tsxFile · 0.90
EditorInstance.tsxFile · 0.90
BlocksProvider.tsxFile · 0.90
TraitsProvider.tsxFile · 0.90
useEditorFunction · 0.85
useEditorMaybeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected