import { useRef } from 'react'; import type { FC, PropsWithChildren } from 'react'; import { StoreApi } from 'zustand'; 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;