Skip to content

Error using atomWithStorage with getOnInit in Next.js: "localStorage is not defined" #2691

Answered by dai-shi
beingtyson asked this question in General
Discussion options

You must be logged in to vote

Don't use getOnInit with SSR framework, such as Next.js. It's for pure client apps.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@beingtyson
Comment options

@beingtyson
Comment options

@johannbuscail
Comment options

Answer selected by beingtyson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2690 on August 02, 2024 07:46.