React hook to load fonts
Posted on 2022-06-11 in Trucs et astuces • Tagged with JavaScript, React
If you need to load a specific font in a component, you can use this hook. It will return true when the fonts are loaded. It relies on the document.fonts API to load the fonts. If the fonts are already loaded, the promise will be fulfilled immediately and the …
Continue reading