chore(rf-provider): use correct type
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
import { useRef, type FC, type PropsWithChildren } from 'react';
|
import { useRef, type FC, type PropsWithChildren } from 'react';
|
||||||
import { type StoreApi } from 'zustand';
|
import { type StoreApi } from 'zustand';
|
||||||
|
import { UseBoundStoreWithEqualityFn } from 'zustand/traditional';
|
||||||
|
|
||||||
import { Provider } from '../../contexts/RFStoreContext';
|
import { Provider } from '../../contexts/RFStoreContext';
|
||||||
import { createRFStore } from '../../store';
|
import { createRFStore } from '../../store';
|
||||||
import type { ReactFlowState } from '../../types';
|
import type { ReactFlowState } from '../../types';
|
||||||
|
|
||||||
const ReactFlowProvider: FC<PropsWithChildren<unknown>> = ({ children }) => {
|
const ReactFlowProvider: FC<PropsWithChildren<unknown>> = ({ children }) => {
|
||||||
const storeRef = useRef<StoreApi<ReactFlowState> | null>(null);
|
const storeRef = useRef<UseBoundStoreWithEqualityFn<StoreApi<ReactFlowState>> | null>(null);
|
||||||
|
|
||||||
if (!storeRef.current) {
|
if (!storeRef.current) {
|
||||||
storeRef.current = createRFStore();
|
storeRef.current = createRFStore();
|
||||||
|
|||||||
Reference in New Issue
Block a user