Is it possible to wrap next-auth Provider within redux Provider?

Viewed 505

If I'm already using next-auth within my next.js app can I add redux around it inside _app.js somehow?

what i tried is this:

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.

is this correct? does it work this way? i'll also need to use redux-saga, new to the whole thing so i'm at a setup stage yet

1 Answers

The answer is YES. You can do that. I've tried myself and it works perfectly.

Related