跑了下官网例子一直报错,能帮忙看下是怎么回事吗? #8154
Unanswered
tomiezhang
asked this question in
Q&A
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
原封不动的copy了官网的例子,跑不通项目实战那块,谁能帮忙看下怎么回事?
Error: Reducer "useProductList" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.
package.json:
{ "private": true, "scripts": { "start": "umi dev", "build": "umi build", "test": "umi test", "lint": "eslint {src,mock,tests}/**/*.{ts,tsx} --fix", "precommit": "lint-staged" }, "dependencies": { "@ant-design/icons": "^4.7.0", "antd": "^4.21.0", "dva": "^2.4.1", "less": "2.7.2", "less-loader": "11.0.0", "react": "^18.2.0-next-f7b44539c-20220610", "react-dom": "^16.8.6" }, "devDependencies": { "@types/jest": "^23.3.12", "@types/react": "^16.7.18", "@types/react-dom": "^16.0.11", "@types/react-test-renderer": "^16.0.3", "babel-eslint": "^9.0.0", "eslint": "^5.4.0", "eslint-config-umi": "^1.4.0", "eslint-plugin-flowtype": "^2.50.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^5.1.1", "eslint-plugin-react": "^7.11.1", "husky": "^0.14.3", "lint-staged": "^7.2.2", "react-test-renderer": "^16.7.0", "umi": "^2.9.0", "umi-plugin-react": "^1.8.0", "umi-types": "^0.3.0" }, "lint-staged": { "*.{ts,tsx}": [ "eslint --fix", "git add" ], "*.{js,jsx}": [ "eslint --fix", "git add" ] }, "engines": { "node": ">=8.0.0" } }
Beta Was this translation helpful? Give feedback.
All reactions