fix(use-storage): using with SSR#2053
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2053 +/- ##
==========================================
- Coverage 77.48% 76.13% -1.35%
==========================================
Files 25 25
Lines 755 771 +16
Branches 94 97 +3
==========================================
+ Hits 585 587 +2
- Misses 162 175 +13
- Partials 8 9 +1 ☔ View full report in Codecov by Sentry. |
| typeof window.sessionStorage !== 'undefined' | ||
| ) | ||
|
|
||
| const createMemoryStorage = (): Storage => { |
There was a problem hiding this comment.
Missing unit test on this part
ea4e8bc to
aba524c
Compare
I am using Nextjs 14 and I am receiving some errors on build time because this package are using
windowdirectly when getting the storage. I created thegetStorage()function that usecanUseDOMto check if we can accesswindowand it returns the corresponding storage.Now I am able to use it with Nextjs.