-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetchData and server-side rendering #134
Comments
And you're certain that |
I'd also put a |
arePagesLoaded and areCategoriesLoaded both return false, and the slug is correct. The troublesome one is loadPage, not the general methods. |
I'm guessing it's pages.js:17. promise: (client) => client.get(`/pages/${slug}.json`) should be promise: (client) => client.get(`/api/pages/${slug}.json`)
|
No, nevermind. None of them should have |
Because |
Actually, after adding /api/ it worked! Looks like it failed while rendered on server. Thanks for the idea and for your attention to the issue in general! |
👍 |
Basing on provided setup, I created two nested routes and components: App and Page. Both of them have fetchData method producing promises for dispatched LOAD actions for API calls. There are three actions: two in App, one in Page component. First two does not require any information from router, the last one depends on a page_slug provided. And, in general, everything works just fine.
But, surprisingly, only first two API calls are being made on server side. The last one works only when the page is loaded into browser: thus, no server-side rendering occurs. I tried to move all three actions into single App component's fetchData method, and it did not help.
I would really appreciate any help on this issue.
Full project is located at https://github.com/gbezyuk/django-react-redux-universal-hot-example
The text was updated successfully, but these errors were encountered: