@anishpras/create-portfolio
Version:
🏗 Personal CLI to bootstrap new portfolio from the given templates.
16 lines (12 loc) • 384 B
JavaScript
import React from "react";
// a custom hook to detect when custom fonts have finished loading
export function useIsFontReady() {
const [isReady, setIsReady] = React.useState(false);
React.useEffect(() => {
// https://developer.mozilla.org/en-US/docs/Web/API/Document/fonts
document.fonts.ready.then(() => {
setIsReady(true);
});
}, []);
return isReady;
}