useWorkbookEditor
function useWorkbookEditor(options?): | EditorHandle | null;An editor for a React component: made when the component mounts and
destroyed, with its worker, when it unmounts. It’s null on the first
render, before it’s made, so render <WorkbookEditor> once it isn’t.
-
fileis opened when the editor is ready, and again when it changes. -
Theme, language, user, schemas and custom lists follow
optionsas they change, without closing the workbook. A new array or object with the same entries isn’t a change, so they can be written inline. -
onSave,onEvent,onErrorandonLinkClickcan be new functions on every render: the editor calls the latest. Whether there’s anonSaveat all is read when the editor is made. -
Every other option is read when the editor is made. To change one, give the component a new
key, which makes a new editor.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
WorkbookEditorHookOptions |
Returns
Section titled “Returns”| EditorHandle
| null