Skip to content
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

Persistent sidebar [Question] #3891

Closed
1 task done
rashidul0405 opened this issue Feb 26, 2018 · 3 comments
Closed
1 task done

Persistent sidebar [Question] #3891

rashidul0405 opened this issue Feb 26, 2018 · 3 comments

Comments

@rashidul0405
Copy link
Contributor

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.

  • I have searched the issues of this repository and believe that this is not a duplicate.

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.

@timneutkens
Copy link
Member

Duplicate of #88

@postor
Copy link

postor commented Mar 2, 2018

@rashidul0405
Copy link
Contributor Author

rashidul0405 commented Mar 5, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants