3

I was trying to implement the next-redux-wrapper with redux-toolkit. As the example suggests in https://github.com/kirill-konshin/next-redux-wrapper/blob/master/packages/demo-redux-toolkit/pages/_app.tsx.

As the example suggests, the store should be wrapper with the useWrappedStore method. Unfortunately, it's not found anywhere in the library.

const MyApp: FC<AppProps> = ({Component, ...rest}) => {
    const {store, props} = wrapper.useWrappedStore(rest);
    return (
        <Provider store={store}>
            <Component {...props.pageProps} />
        </Provider>
    );
};

export default MyApp;

Anyone have any idea how to solve this?

Ramees Salim
  • 31
  • 1
  • 3
  • Is your code exactly the same as the example? Where are you importing `wrapper` from? – juliomalves Dec 10 '21 at 13:55
  • 2
    Got the solution.. [https://github.com/kirill-konshin/next-redux-wrapper/issues/439#issuecomment-991138041] As they mentioned, their examples uses the version 8.0.0-rc.1 and the main branch is still 7 – Ramees Salim Dec 12 '21 at 08:57

0 Answers0