I'm using two libraries in my NextJs app: next-firebase-auth
and next-redux-wrapper
. Both of them require me to wrap getServerSideProps
with their respective functions.
For next-firebase-auth
export const getServerSideProps = withAuthUserSSR()(async ({ AuthUser }) => {
// Some code
})
For next-redux-wrapper
export const getServerSideProps = wrapper.getServerSideProps(
({store}) => {
// Some code
}
);
Both work individually but I was unable to get the two working simultaneously. NextJs only allows getServerSideProps
to be declared once. Is it possible to somehow combine multiple wrappers?