font-manager
font-manager copied to clipboard
check for document before appending stylesheet
closes #4
It still needs to be initialised when the window/document is available.
function useFontManager(
apiKey: string,
props: Partial<Props>,
options: Options,
) {
const [fontManager, setFontManager] = React.useState<FontManager>()
React.useEffect(() => {
if (typeof window !== 'undefined') {
setFontManager(
new FontManager(
apiKey,
props.activeFontFamily,
options,
props.onChange,
),
)
}
}, [])
return fontManager
}
sadly the whole project seems dead. thanks to @samuelmeuli for delivering this, but I would not use it as unmaintained,
@bacloud22 do you know of any alternatives.
Nope, unfortunately. Good luck