gpt4 book ai didi

reactjs - Module not found : can't resolve' redux-thunk ' error I have tried the solutions but it does not happen. 解决办法是什么?

转载 作者:行者123 更新时间:2023-12-03 23:35:12 27 4
gpt4 key购买 nike

我尝试了 redux 的所有命令,但它不起作用:你认为解决方案如何。这些是我尝试过的命令

yarn add react-redux
yarn add reduxjs / Redux-thunk#master
npm install --save Redux react-redux
npm install redux -- save
npm i redux -- save
yarn add redux-thunk

索引.jsx
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import {createStore, applyMiddleware,compose} from 'redux';
import rootReducer from './store/reducers/rootReducer';
import {Provider} from 'react-redux';
import thunk from 'redux-thunk';
import {reduxFirestore,getFirestore} from 'redux-firestore'
import {reactReduxFirebase,getFirebase} from 'react-redux-firebase'
import fbConfig from './config/fbConfig';


const store=createStore(rootReducer,
compose(
applyMiddleware(thunk.withExtraArgument({getFirebase,getFirestore})),
reduxFirestore(fbConfig),
reactReduxFirebase(fbConfig)
));


ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root'));

包.json
{
"name": "omaga-yazilim",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^npm i --save react-router4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^7.2.1",
"firebase": "^7.8.1",
"jest-leak-detector": "^25.1.0",
"moment": "^2.22.2",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-redux": "^7.1.3",
"react-redux-firebase": "^3.1.1",
"react-router": "^4.4.0-beta.8",
"react-router-dom": "^4.4.0-beta.6",
"react-scripts": "^2.1.1",
"redux": "^4.0.5",
"redux-firestore": "^0.12.0",
"redux-thunk": "reduxjs/redux-thunk#master",
"start": "webpack-dev-server --mode development"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

最佳答案

我遇到了同样的问题,但我运行命令行:

npm install --save redux-thunk

关于reactjs - Module not found : can't resolve' redux-thunk ' error I have tried the solutions but it does not happen. 解决办法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60196950/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com