是否可以将 next-auth Provider 包装在 redux Provider 中?

问题描述

如果我已经在我的 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,这是整个过程的新手,所以我还处于设置阶段

解决方法

答案是肯定的。你可以这样做。我自己试过了,效果很好。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...