seedling/source/ui/src/providers/Redux.tsx
Roman Jaroš 616205fe73
All checks were successful
forgejo/Procyon/seedling/pipeline/pr-master This commit looks good
forgejo/Procyon/seedling/pipeline/head This commit looks good
Replace UI module with Next.js
2023-12-29 15:09:30 +00:00

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>;
}