【发布时间】:2021-05-20 20:35:01
【问题描述】:
我在 NextJs 应用程序中使用了两个库:next-firebase-auth 和 next-redux-wrapper。它们都要求我用它们各自的功能包装getServerSideProps。
对于next-firebase-auth
export const getServerSideProps = withAuthUserSSR()(async ({ AuthUser }) => {
// Some code
})
对于next-redux-wrapper
export const getServerSideProps = wrapper.getServerSideProps(
({store}) => {
// Some code
}
);
两者都单独工作,但我无法让两者同时工作。 NextJs 只允许getServerSideProps 被声明一次。是否有可能以某种方式组合多个包装器?
【问题讨论】:
标签: javascript firebase-authentication next.js next-redux-wrapper