如果我已经在我的next.js应用程序中使用next-auth,我可以在_app.js中添加redux吗? 我尝试的是这样的: import React from "react"
import { Provider } from 'next-auth/client'
import {Provider as ReduxProvider} from 'react-redux';
import {configureStore} from './store/configureStore';
import '../public/s
有人能帮上忙吗
Error: Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware
挂载的sagaMiddleware仍然在页面上抛出一个错误
在存储中添加了redux-saga和saga中间件
商店Js
import { createStore, applyMiddleware, compose } from "redux";
import { persistStore } from "redux-persist";
import
WARNING in ./node_modules/@redux-saga/core/dist/redux-saga-core.esm.js 1343:21-28
"export 'compose' was not found in 'redux'
@ ./node_modules/redux-saga/dist/redux-saga-core-npm-proxy.esm.js
@ ./src/store.js
@ ./src/App.js
@ ./src/index.js
WARNING in ./src/store.js 6:21-32
&
所以,我试着为我的Redux组件做一个小测试,在这个测试中,我只发送了空的obj {}。并尝试在我的测试文件中与之相等,如expect(get).toEqual(obj)。我在错误日志中得到的信息:
$ yarn test
yarn run v1.5.1
warning ..\..\..\..\package.json: No license field
$ react-scripts test --env=jsdom
FAIL src\saga\saga.test.js
● get new action value
expect(received).toEqual(expected
js像这样
import {createStore, applyMiddleware, combineReducers} from 'redux'
import {composeWithDevTools} from 'redux-devtools-extension'
import withRedux from 'next-redux-wrapper'
import nextReduxSaga from 'next-redux-saga'
import createSagaMiddleware from 'redux-sa
我想在下一个js项目中添加屏幕加载。我尝试使用next/router中的路由器组件来实现这一点。
这是我在next.js项目中的_app.js:
import {CookiesProvider} from 'react-cookie';
import App from 'next/app'
import React from 'react'
import {Provider} from 'react-redux'
import withRedux from 'next-redux-wrapper'
import w
我正在使用redux-saga的React-router-v4。我的问题是一旦用户登录,我想把他重定向到主页,所以从答案提到的与{withRouter}我尝试,但它不起作用,有人能让我知道我应该如何做redux-saga我看到了答案这是唯一的方法吗?
下面是我的redux saga代码
import { takeLatest } from 'redux-saga';
import {LOG_IN,LOG_INS,LOG_IN_ERROR} from '../constants/actionTypes';
import { call, put } from