kirill-konshin/next-redux-wrapper

/!\ You are using legacy implementation. Please update your code: use createWrapper() and wrapper.useWrappedStore().

Opened this issue · 1 comments

I am using the latest implementation and it does not work
import { configureStore } from '@reduxjs/toolkit';
import { createWrapper } from 'next-redux-wrapper';
import themeReducer from './themeSlice';
import chatBotLogicReducer from './chatBotLogicSlice';
import chatHeaderDesignSlice from './chatHeaderDesignSlice';
import chatBotHeaderDescriptionSlice from './chatBotHeaderDescriptionSlice';

export const makeStore = () =>
configureStore({
reducer: {
theme: themeReducer,
chatHeaderDesignSlice: chatHeaderDesignSlice,
chatBotLogic: chatBotLogicReducer,
chatBotHeaderDescription: chatBotHeaderDescriptionSlice,
},
});

export const wrapper = createWrapper(makeStore);
// _app.js
import AppWrapper from './AppWrapper';
import { wrapper } from '../store/store.js';
import '../app/globals.css';
import EclipseAnimation from '@/components/Eclipsetoggle';

function MyApp({ Component, pageProps }) {
return (

<EclipseAnimation onToggleMode={() => {}} />
<Component {...pageProps} />

);
}

export default wrapper.withRedux(MyApp);
it is not clear how one implements this new version

Solution: #488 (comment)

Discussed in #488