@atlaskit/editor-plugin-toolbar
Version:
Toolbar plugin for @atlaskit/editor-core
8 lines • 431 B
JavaScript
import { createContext, useContext } from 'react';
/**
* State of the element toolbar the host is showing, starting with its node. The node changes on
* each edit inside it, so `ElementToolbarPopup` re-renders and repositions without re-rendering
* the toolbar items.
*/
export const ElementToolbarContext = /*#__PURE__*/createContext(undefined);
export const useElementToolbarContext = () => useContext(ElementToolbarContext);