Next.js 'use client' #958
Answered
by
dai-shi
talltyler
asked this question in
Bug report
-
Bug DescriptionUsing useSnapshot in Next.js forces the need for 'use client'
This is using valtio 2.0.0 and next 14.2.13 Reproduction Linkhttps://stackblitz.com/edit/stackblitz-starters-e425py?file=app%2Fpage.tsx |
Beta Was this translation helpful? Give feedback.
Answered by
dai-shi
Sep 27, 2024
Replies: 2 comments 1 reply
-
Yes, |
Beta Was this translation helpful? Give feedback.
0 replies
-
So components that are going to be rendered on the server can't get their data from a valtio store or is it that they need to access data in another way? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have a valtio store and need to get a snapshot,
snapshot(store)
would do. But, you can directly readstore
too. Be aware that having the store global means it's a global variable that can be shared across multiple sessions / users.