chore: transfer repo
This commit is contained in:
15
lib/redux/provider.tsx
Normal file
15
lib/redux/provider.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import { initializeState } from './slices/boxSlice';
|
||||
import { store } from './store';
|
||||
|
||||
export function ReduxProvider({ children }: { children: React.ReactNode }) {
|
||||
// Inicijaliziraj stanje iz localStorage nakon što se komponenta montira
|
||||
useEffect(() => {
|
||||
store.dispatch(initializeState());
|
||||
}, []);
|
||||
|
||||
return <Provider store={store}>{children}</Provider>;
|
||||
}
|
||||
Reference in New Issue
Block a user