import { useRef, type FC, type PropsWithChildren } from 'react'; import { type StoreApi } from 'zustand'; import { UseBoundStoreWithEqualityFn } from 'zustand/traditional'; import { Provider } from '../../contexts/RFStoreContext'; import { createRFStore } from '../../store'; import type { ReactFlowState } from '../../types'; const ReactFlowProvider: FC> = ({ children }) => { const storeRef = useRef> | null>(null); if (!storeRef.current) { storeRef.current = createRFStore(); } return {children}; }; ReactFlowProvider.displayName = 'ReactFlowProvider'; export default ReactFlowProvider;