UNPKG

@atlaskit/editor-plugin-block-controls

Version:

Block controls plugin for @atlaskit/editor-core

25 lines (24 loc) 1.1 kB
import type { ReactElement } from 'react'; /** * Mounts `element` into `mountPoint`. * * When `platform_editor_react19_migration` is **on**, uses the React 18/19 `createRoot` * API wrapped in `flushSync` so the render is synchronous – matching the * legacy `ReactDOM.render` timing that ProseMirror decoration widgets depend * on (focus management, anchor positioning, block-menu visibility all read * the rendered DOM immediately after the callback returns). * * Otherwise, falls back to the legacy `ReactDOM.render` path. The API is not * available in React 19, so the root path is also selected when the legacy * method has been removed. */ export declare const renderToMountPoint: (element: ReactElement, mountPoint: Element) => void; /** * Unmounts the React tree at `mountPoint`. * * When `platform_editor_react19_migration` is **on**, looks up the root in the shared * registry, calls `root.unmount()`, and removes the entry. * * Otherwise, falls back to `ReactDOM.unmountComponentAtNode`. */ export declare const unmountFromMountPoint: (mountPoint: Element) => void;