Skip to content

Support server side rendering in useLocalStorage #126

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

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

fredrikekelund
Copy link
Contributor

I've added some simple if (typeof window === "undefined") clauses around the localStorage calls.

Don't know if there's a policy around this, but I'm betting a lot of people use these hooks in Next.js and I figured this could be helpful.

I've added some simple `if (typeof window === "undefined")` clauses around the `localStorage` calls.

Don't know if there's a policy around this, but I'm betting a lot of people use these hooks in Next.js and I figured this could be helpful.
@vercel
Copy link

vercel bot commented Oct 27, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/uidotdev/usehooks/F3JDTcPoRkAqJuRULVq6wxbpS7fv
✅ Preview: https://usehooks-git-fork-fredrikekelund-patch-1-uidotdev.vercel.app

@alexanderson1993 alexanderson1993 merged commit b8197c9 into uidotdev:master Feb 8, 2022
benadam11 pushed a commit that referenced this pull request May 29, 2023
Support server side rendering in useLocalStorage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants