google-fonts
google-fonts copied to clipboard
Not working on web, font source is missing uri prop
Hi,
I tried to use this package in pretty fresh project, but run into an issue where nothing happened. My code looks like this:
fontsLoaded stays false and error is always null (but that's another issue). I then did some digging and found out that font source passed to loadAsync looks like this:
But then the FontLoader.web.js in expo-font package expects that object passed to it has property called uri, otherwise invalid source error is thrown.
I modified FontLoader.web.js code like this and it started working, but maybe this package should add this uri prop when user is on web?
Still relevant in 2022.
Thanks so much for sharing
@Njaah-0 Is it necessary to modify the code behind useFonts (FontLoader.web.js) to use it on the web? Could you share your solution or explain what you did a bit further? thx