Skip to content

fix(clerk-js,shared): Safer usage of localStorage#1774

Merged
LekoArts merged 2 commits intomainfrom
lekoarts/js-758-react-nativeexpo-app-with-clerk-tries-to-access-localstorage
Sep 25, 2023
Merged

fix(clerk-js,shared): Safer usage of localStorage#1774
LekoArts merged 2 commits intomainfrom
lekoarts/js-758-react-nativeexpo-app-with-clerk-tries-to-access-localstorage

Conversation

@LekoArts
Copy link
Copy Markdown
Contributor

Description

Check if window is undefined and then have fallback cases for that. Since the hook seems to be modeled after https://usehooks-ts.com/react-hook/use-local-storage I applied its window checks that it has.

Fixes #1620

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@LekoArts LekoArts requested a review from a team as a code owner September 25, 2023 11:29
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 25, 2023

🦋 Changeset detected

Latest commit: f4d9267

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@clerk/clerk-js Patch
@clerk/shared Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/fastify Patch
@clerk/clerk-react Patch
@clerk/remix Patch
gatsby-plugin-clerk Patch
@clerk/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LekoArts LekoArts added this pull request to the merge queue Sep 25, 2023
Merged via the queue into main with commit 0eb6661 Sep 25, 2023
@LekoArts LekoArts deleted the lekoarts/js-758-react-nativeexpo-app-with-clerk-tries-to-access-localstorage branch September 25, 2023 12:12
@clerk-cookie clerk-cookie mentioned this pull request Sep 25, 2023
@clerk-cookie
Copy link
Copy Markdown
Collaborator

This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@clerk clerk locked as resolved and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React Native/Expo app with Clerk tries to access localStorage, which is bad

3 participants