16 lines
431 B
TypeScript
16 lines
431 B
TypeScript
// @ts-nocheck
|
|
'use client';
|
|
|
|
import { useRef, ReactNode } from 'react';
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { makeStore } from '../redux/store';
|
|
|
|
export function ReduxProvider({ children }: { children: ReactNode }) {
|
|
const storeRef = useRef<ReturnType<typeof makeStore> | null>(null);
|
|
if (!storeRef.current) {
|
|
storeRef.current = makeStore();
|
|
}
|
|
|
|
return <Provider store={storeRef.current}>{children}</Provider>;
|
|
}
|