github udecode/plate @platejs/core@49.0.4

latest releases: @platejs/dnd@49.2.22, @platejs/core@49.2.21, @platejs/slate@49.2.21...
2 months ago

Patch Changes

  • #4373 by @zbeyens

    • 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 for createPlateEditor and usePlateEditor. If async, usePlateEditor will trigger a re-render when the value is loaded.
    • Added onReady callback option to createPlateEditor and usePlateEditor 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);
      },
    });

Don't miss a new plate release

NewReleases is sending notifications on new releases.