Create a client Nextjs page to store tokens in zustand #2901
-
Hello eceryone, My main reason to post this question, is that is it a good approach to create a client side page, that runs my Store's setter function to store tokens acquire on the server side? Basically, I don't render anything but a loading skeleton on the client side page, but in the background it calls my store's setter function to save my secret tokens acquired by server actions. What are you taughts on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@andrejmoltok you could create your store with tokens from server |
Beta Was this translation helpful? Give feedback.
@andrejmoltok no, you can create your store from the beginning with that data. Ref: https://zustand.docs.pmnd.rs/guides/nextjs#initializing-the-store