vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.1k stars 27k forks source link

Redux-saga action not updating state when invoked from getInitialProps #5889

Closed apl9000 closed 5 years ago

apl9000 commented 5 years ago

I've not been able to properly configure redux and more specifically redux sagas into my project. When dispatching an action in getInitialProps nothing happens. Here are the relevant files that I think are relevant to the issue. I've also noted in comments where the code seems to stop executing.

In the official example, Next.js getInitialProps seems to expect the store and isServer to be on the props.ctx object, but is present on props object directly.

_document.js _document

_app.js _app

/pages/products.js product

store.js store

rootSaga.js rootsaga

example/action.js action

example/saga.js saga

timneutkens commented 5 years ago

Again please follow the issue template, it clearly says questions should be posted on https://spectrum.chat/next-js, as the community is there. And if you don't create the question there we have bug/feature template that ask for more context than you're currently are providing. It's close to impossible to help with screenshots of your code.