3

如果我已经在我的 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,对整个事情来说都是新的,所以我还处于设置阶段

4

1 回答 1

0

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

于 2021-03-10T08:52:13.317 回答