I am trying to use expo google font but it show error fontFamily “open-sans-bold” is not a system font and has not been loaded through Font.loadAsync.
-
If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.
-
If this is a custom font, be sure to load it with Font.loadAsync.
i also tried using Font.loadAsync. but it showing same error
code
import React from “react”;
import { Text, View } from “react-native”;
import { createStore, combineReducers } from “redux”;
import { Provider } from “react-redux”;
import AppLoading from “expo-app-loading”;
import ProductReducer from “./store/reducers/products”;
import ShopNavigator from “./navigation/ShopNavigator”;
import {
OpenSans_300Light,
OpenSans_600SemiBold,
OpenSans_700Bold,
} from “@expo-google-fonts/open-sans”;
import {
useFonts,
Poppins_300Light,
Poppins_400Regular,
Poppins_400Regular_Italic,
Poppins_500Medium,
Poppins_700Bold,
Poppins_900Black,
} from “@expo-google-fonts/poppins”;
const rootReducer = combineReducers({
products: ProductReducer,
});
const store = createStore(rootReducer);
export default function App() {
let [fontsLoaded] = useFonts({
"open-sans": OpenSans_300Light,
"open-sans-bold": OpenSans_600SemiBold,
"Poppins-Bold": Poppins_700Bold,
});
if (!fontsLoaded) {
return <AppLoading />;
}
return (
<Provider store={store}>
<ShopNavigator />
</Provider>
);
}