@oliasoft-open-source/react-ui-library 4.15.2-beta-3 → 4.15.2-beta-4
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/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19957,10 +19957,20 @@ const useFocus = () => {
|
|
|
19957
19957
|
};
|
|
19958
19958
|
const useFontsReady = () => {
|
|
19959
19959
|
const [isFontLoaded, setFontLoaded] = useState(false);
|
|
19960
|
+
const isMounted = useRef(true);
|
|
19961
|
+
useEffect(() => {
|
|
19962
|
+
return () => {
|
|
19963
|
+
isMounted.current = false;
|
|
19964
|
+
};
|
|
19965
|
+
}, []);
|
|
19960
19966
|
useEffect(() => {
|
|
19961
19967
|
const fontIsReady = async () => {
|
|
19962
19968
|
if (!document.fonts) return;
|
|
19963
|
-
await document.fonts.ready.then(() =>
|
|
19969
|
+
await document.fonts.ready.then(() => {
|
|
19970
|
+
if (isMounted.current) {
|
|
19971
|
+
setFontLoaded(true);
|
|
19972
|
+
}
|
|
19973
|
+
});
|
|
19964
19974
|
};
|
|
19965
19975
|
fontIsReady();
|
|
19966
19976
|
}, []);
|