In my NextJs app, I am integrating two libraries: next-firebase-auth
and next-redux-wrapper
. Each library requires me to wrap the getServerSideProps
function with its own specific logic.
Here's how it looks for next-firebase-auth
:
export const getServerSideProps = withAuthUserSSR()(async ({ AuthUser }) => {
// Implement some functionality
})
And this is how it appears for next-redux-wrapper
:
export const getServerSideProps = wrapper.getServerSideProps(
({store}) => {
// Handle some tasks
}
);
While both of these wrappers work independently, combining them has proven challenging. Since NextJs only allows one declaration of getServerSideProps
, I have been unable to use both wrappers together. Is there a way to combine multiple wrappers in NextJs?