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

[Question] Access to store state inside SSR Next.js #521

Closed
ProxyJoshua opened this issue Aug 4, 2021 · 2 comments
Closed

[Question] Access to store state inside SSR Next.js #521

ProxyJoshua opened this issue Aug 4, 2021 · 2 comments
Labels
Type: Question (feel free to answer) This is about usage question (free free to answer)

Comments

@ProxyJoshua
Copy link

It is possible to access to the store inside the getServerSideProps function? Is there any option? I want to avoid some api request if the data it is already loaded in the store

@dai-shi
Copy link
Member

dai-shi commented Aug 5, 2021

Store state can be accessed with useStore.getState(). Note that it's shared in SSR #182.

@dai-shi dai-shi added the Type: Question (feel free to answer) This is about usage question (free free to answer) label Aug 5, 2021
@dai-shi
Copy link
Member

dai-shi commented Sep 30, 2021

Closing as partly answered. If you want to continue discussions, please open a new discussion maybe with some code snippet.

@dai-shi dai-shi closed this as completed Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question (feel free to answer) This is about usage question (free free to answer)
Projects
None yet
Development

No branches or pull requests

2 participants