UNPKG

phx-react

Version:

PHX REACT

10 lines 559 B
import { createEmptyHistoryState } from '@lexical/react/LexicalHistoryPlugin'; import * as React from 'react'; import { createContext, useContext, useMemo } from 'react'; const Context = createContext({}); export const SharedHistoryContext = ({ children }) => { const historyContext = useMemo(() => ({ historyState: createEmptyHistoryState() }), []); return React.createElement(Context.Provider, { value: historyContext }, children); }; export const useSharedHistoryContext = () => useContext(Context); //# sourceMappingURL=SharedHistoryContext.js.map