Closed rashidul0405 closed 6 years ago
Duplicate of https://github.com/zeit/next.js/issues/88
single store, provider and connect If you are using redux, just use one that will prisist store like https://github.com/nextjs-boilerplate/next.js-redux-helper
closure,HOC only or only some components may need to prisist state, you can use https://github.com/postor/next-prisist-state which will keep in closure and you need to take care of memory leak
Thank you @postor. For this project, I skipped Redux in favor of unstated (just for global user data etc.). I did this using HOC. just like with-intl example, on server I fetch the data from API and on client read the data from __NEXT_DATA__
. So fetch once and reused on every page.
We need a sidebar which is a category tree of an e-commerce site, fetched from DB(pls check this example - ffshop : left menu - building the next version of it).
This should only load once - at very first time (server rendered) like react router example
How can I fetch this initially - using HOC? I use layout component and also checked HOC
I think this may be related to #3461, #3552.
next.js match in every aspect of our need but looks like it falls a bit short in this use case. Building another site which also requires rendering dynamic menu from DB. I would like to contribute.