[Bug] withRedux doesn't work with getStaticProps
neo opened this issue · 4 comments
neo commented
the withRedux
wrapper which uses getInitialProps
under the hood, isn't compatible with using getStaticProps
because only either one or the other could be present, but not both.
neo commented
maybe this could be a potential solution?
https://github.com/kirill-konshin/next-redux-wrapper#getstaticprops
neo commented
I think they also updated their example: https://github.com/vercel/next.js/tree/canary/examples/with-redux
neo commented
now that I have actually used this, I think for ssg we should use provide the store with the initial state in _app.js
? because most of these complicated methods are trying to solve problems for ssr, which we don't use often.