Patch Changes
-
- Fixes #4374
- Prevent rendering the editor until the value is loaded (when value is async or
skipInitialization
is true). - Added support for both synchronous and asynchronous functions in the
value
option forcreatePlateEditor
andusePlateEditor
. If async,usePlateEditor
will trigger a re-render when the value is loaded. - Added
onReady
callback option tocreatePlateEditor
andusePlateEditor
called after (async) editor initialization.
const editor = usePlateEditor({ value: async () => { const response = await fetch('/api/document'); const data = await response.json(); return data.content; }, onReady: ({ editor, value }) => { console.info('Editor ready with value:', value); }, });