UNPKG

@atlaskit/editor-plugin-block-controls

Version:

Block controls plugin for @atlaskit/editor-core

23 lines (22 loc) 987 B
import type { ReactElement } from 'react'; /** * Mounts `element` into `mountPoint`. * * When `nike_r19_render_unmount` 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). * * When the gate is **off**, falls back to the legacy `ReactDOM.render` path. */ export declare const renderToMountPoint: (element: ReactElement, mountPoint: Element) => void; /** * Unmounts the React tree at `mountPoint`. * * When `nike_r19_render_unmount` is **on**, looks up the root in the shared * registry, calls `root.unmount()`, and removes the entry. * * When the gate is **off**, falls back to `ReactDOM.unmountComponentAtNode`. */ export declare const unmountFromMountPoint: (mountPoint: Element) => void;