MCPcopy Create free account
hub / github.com/editablejs/editable / useReadOnly

Function useReadOnly

packages/plugins/codeblock/src/hooks/use-read-only.ts:5–7  ·  view source on GitHub ↗
(view: EditorView | null, readOnly: boolean)

Source from the content-addressed store, hash-verified

3import { useExtension } from './use-extension'
4
5export function useReadOnly(view: EditorView | null, readOnly: boolean) {
6 return useExtension(view, () => [EditorState.readOnly.of(readOnly)], [readOnly])
7}

Callers 1

CodeBlockComponentFunction · 0.90

Calls 1

useExtensionFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…