小编Tec*_*rav的帖子

下一个 redux 包装器出现无法读取未定义属性 'getState' 的错误

在此处输入图片说明

在这个项目中,我将下一个 js 库与 redux 一起使用,并且我还使用下一个 redux 包装器我按照下一个 redux 包装器文档中提到的进行了所有操作,但是这里无法正常工作,当我显示在上图。所以在这里我调试了所有代码,但我找不到这个错误发生的地方。我在下面列出了我在 react js 文件中完成的代码。

_app.js

import React from "react";
import App from "next/app";
import { Provider } from "react-redux";
import withRedux from "next-redux-wrapper";
import makeStore from ".././src/config/store";

class ConsoleApp extends App {
  /**
   * Render View
   */
  render() {
    const { Component, pageProps, store } = this.props;
    return (
      <Provider store={store}>
        <Component {...pageProps} />
      </Provider>
    );
  }
}

export default withRedux(makeStore)(ConsoleApp);

Run Code Online (Sandbox Code Playgroud)

root-reducer.js

/**
 * Import Dependencies
 */
import { combineReducers } from …
Run Code Online (Sandbox Code Playgroud)

reactjs redux react-redux next.js next-redux-wrapper

4
推荐指数
1
解决办法
1957
查看次数