Skip to content

Fix storage hooks return types #1647

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joedelia
Copy link

@joedelia joedelia commented Apr 11, 2025

What is the current behavior, and the steps to reproduce the issue?

useSessionStorageValue with a defaultValue and no initializeWithValue returns typeof defaultValue | undefined.

What is the expected behavior?

It should not have undefined as a possible return type, as we have a defaultValue and initializeWithValue defaults to true.

How does this PR fix the problem?

We correctly check that initializeWithValue is actually false.

Checklist

  • Have you read contribution guideline?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Is there an existing issue for this PR?
    • link issue here
  • Have the files been linted and formatted?
  • Have the docs been updated to match the changes in the PR?
  • Have the tests been updated to match the changes in the PR?
  • Have you run the tests locally to confirm they pass?

@joedelia
Copy link
Author

Hey @xobotyi sorry I haven't created an issue first, just went ahead and checked the issue. Let me know if it's cool to merge or if we should fork for our org use! Thank you for maintaining this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant