@reactuses/core 5.0.21 → 5.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -8
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,11 +86,4 @@ This project is heavily inspired by the following awesome projects.
|
|
|
86
86
|
|
|
87
87
|
If my work has helped you, consider buying me a cup of coffee. Thank you very much🥰!.
|
|
88
88
|
|
|
89
|
-
[Buy me a coffee](https://www.buymeacoffee.com/lianwenwu)
|
|
90
|
-
|
|
91
|
-
### For Chinese User
|
|
92
|
-
|
|
93
|
-
<p float="left">
|
|
94
|
-
<img src="https://d21002cb.images-f3o.pages.dev/images/wechat.jpg" alt="Wechat Pay" width="200" />
|
|
95
|
-
<img src="https://d21002cb.images-f3o.pages.dev/images/ali.jpg" alt="Ali Pay" width="200" />
|
|
96
|
-
</p>
|
|
89
|
+
[Buy me a coffee](https://www.buymeacoffee.com/lianwenwu)
|
package/dist/index.cjs
CHANGED
|
@@ -562,7 +562,7 @@ function guessSerializerType(rawInit) {
|
|
|
562
562
|
|
|
563
563
|
const StorageSerializers = {
|
|
564
564
|
boolean: {
|
|
565
|
-
read: (v)=>v ===
|
|
565
|
+
read: (v)=>v === 'true',
|
|
566
566
|
write: (v)=>String(v)
|
|
567
567
|
},
|
|
568
568
|
object: {
|
|
@@ -611,8 +611,8 @@ function getInitialState$3(key, defaultValue, storage, serializer, onError) {
|
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
// A default value has not been provided, and you are rendering on the server, warn of a possible hydration mismatch when defaulting to false.
|
|
614
|
-
if (process.env.NODE_ENV !==
|
|
615
|
-
console.warn(
|
|
614
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
615
|
+
console.warn('`createStorage` When server side rendering, defaultValue should be defined to prevent a hydration mismatches.');
|
|
616
616
|
}
|
|
617
617
|
return null;
|
|
618
618
|
}
|
|
@@ -680,8 +680,8 @@ function useStorage(key, defaultValue, getStorage = ()=>isBrowser ? sessionStora
|
|
|
680
680
|
});
|
|
681
681
|
React.useEffect(()=>{
|
|
682
682
|
if (listenToStorageChanges) {
|
|
683
|
-
window.addEventListener(
|
|
684
|
-
return ()=>window.removeEventListener(
|
|
683
|
+
window.addEventListener('storage', listener);
|
|
684
|
+
return ()=>window.removeEventListener('storage', listener);
|
|
685
685
|
}
|
|
686
686
|
return ()=>{};
|
|
687
687
|
}, [
|
package/dist/index.mjs
CHANGED
|
@@ -554,7 +554,7 @@ function guessSerializerType(rawInit) {
|
|
|
554
554
|
|
|
555
555
|
const StorageSerializers = {
|
|
556
556
|
boolean: {
|
|
557
|
-
read: (v)=>v ===
|
|
557
|
+
read: (v)=>v === 'true',
|
|
558
558
|
write: (v)=>String(v)
|
|
559
559
|
},
|
|
560
560
|
object: {
|
|
@@ -603,8 +603,8 @@ function getInitialState$3(key, defaultValue, storage, serializer, onError) {
|
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
// A default value has not been provided, and you are rendering on the server, warn of a possible hydration mismatch when defaulting to false.
|
|
606
|
-
if (process.env.NODE_ENV !==
|
|
607
|
-
console.warn(
|
|
606
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
607
|
+
console.warn('`createStorage` When server side rendering, defaultValue should be defined to prevent a hydration mismatches.');
|
|
608
608
|
}
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
@@ -672,8 +672,8 @@ function useStorage(key, defaultValue, getStorage = ()=>isBrowser ? sessionStora
|
|
|
672
672
|
});
|
|
673
673
|
useEffect(()=>{
|
|
674
674
|
if (listenToStorageChanges) {
|
|
675
|
-
window.addEventListener(
|
|
676
|
-
return ()=>window.removeEventListener(
|
|
675
|
+
window.addEventListener('storage', listener);
|
|
676
|
+
return ()=>window.removeEventListener('storage', listener);
|
|
677
677
|
}
|
|
678
678
|
return ()=>{};
|
|
679
679
|
}, [
|