Skip to content

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

@Abeerahmad566

Description

@Abeerahmad566

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions