Skip to content

Instantly share code, notes, and snippets.

@iampoul
Created April 19, 2022 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iampoul/605fb81edc70ee005e61bb35df11fc5f to your computer and use it in GitHub Desktop.
Save iampoul/605fb81edc70ee005e61bb35df11fc5f to your computer and use it in GitHub Desktop.
wrap react app in multiple providers
import React from "react"
// import 'as' alias to prevent naming conflicts
import { Provider as NextAuthProvider } from 'next-auth/client'
import { Provider as ReduxProvider } from 'react-redux'
export default function App ({ Component, pageProps }) {
return (
<ReduxProvider>
<NextAuthProvider options={{ ... }}>
<Component {...pageProps} />
</NextAuthProvider>
</ReduxProvider>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment