问题描述
如果我已经在我的 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/styles.css'
const store = configureStore();
export default function App ({ Component,pageProps }) {
return (
<ReduxProvider store={store}>
<Provider
// next-auth params,etc.
这是正确的吗?它是这样工作的吗? 我还需要使用 redux-saga,这是整个过程的新手,所以我还处于设置阶段
解决方法
答案是肯定的。你可以这样做。我自己试过了,效果很好。