Skip to content
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

fix(useStorageValue): make methods to be stable between renders #1015

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented Nov 10, 2022

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

useStoageValue methods are not stable between renders, after state change.

What is the expected behavior?

Methods should not change between renders

How does this PR fix the problem?

Wrap methods with useMemo and interpolate them into returned object.

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?
  • 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?

@xobotyi xobotyi added the 🕯️ bug fix One or more bugs fixed label Nov 10, 2022
@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #1015 (56c0184) into master (12f723d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1015   +/-   ##
=======================================
  Coverage   99.60%   99.61%           
=======================================
  Files          60       60           
  Lines        1025     1030    +5     
  Branches      161      161           
=======================================
+ Hits         1021     1026    +5     
  Misses          2        2           
  Partials        2        2           
Impacted Files Coverage Δ
src/useStorageValue/useStorageValue.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@xobotyi xobotyi merged commit 2211bb7 into master Nov 10, 2022
@xobotyi xobotyi deleted the fix-1014 branch November 10, 2022 12:42
github-actions bot pushed a commit that referenced this pull request Nov 10, 2022
## [18.0.1](v18.0.0...v18.0.1) (2022-11-10)

### Bug Fixes

* **useStorageValue:** make methods to be stable between renders ([#1015](#1015)) ([2211bb7](2211bb7)), closes [#1014](#1014)
@xobotyi
Copy link
Contributor Author

xobotyi commented Nov 10, 2022

🎉 This PR is included in version 18.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕯️ bug fix One or more bugs fixed released
Development

Successfully merging this pull request may close these issues.

2 participants