Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types issue with 8.0.1 version of Next Redux Wrapper and Nextjs 13.4.19 #561

Open
Abeerahmad566 opened this issue Oct 27, 2023 · 0 comments
Labels

Comments

@Abeerahmad566
Copy link

Property 'query','store','res' does not exist on type 'Store<any, AnyAction>'.

When i updated the next redux wrapper from version 6.0.2 to 8.0.1 it starts giving me error
Property query','store','res' does not exist on type 'Store<any, AnyAction>'.

  • Here is screenshot
Screenshot 2023-10-27 at 1 14 06 PM
  • This is my createStore file code:
    import {
    createStore,
    applyMiddleware,
    Store,
    Middleware,
    AnyAction,
    } from 'redux';
    import { createWrapper, HYDRATE } from 'next-redux-wrapper';
    import thunk from 'redux-thunk';
    import rootReducer, { AppState } from './index';

const bindMiddleware = (middleware: Middleware[]) => {
if (process.env.NODE_ENV !== 'production') {
const { composeWithDevTools } = require('redux-devtools-extension');
return composeWithDevTools(applyMiddleware(...middleware));
}
return applyMiddleware(...middleware);
};

export function configureStore(initialState = {}): Store {
const middleware = [thunk];
const store = createStore(
rootReducer,
initialState,
bindMiddleware(middleware)
);

return store;
}

const reducer = (state: AppState, action: AnyAction) => {
if (action.type === HYDRATE) {
return {
...state,
...action.payload,
};
}

return rootReducer(state, action);
};

const makeStore = () => createStore(reducer, {}, bindMiddleware([thunk]));
export const wrapper = createWrapper(makeStore, { debug: false });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant