all,
I am new to react native, currently, I am having an issue with customized fonts usage. My issue is: font files not exists though I already put my fonts files in directory: ./assets/fonts error image
I am following steps of Expo documentation of using customized fonts, which is installing expo-font and using useFont hook. My code as following:
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import AuthStack from './routes/authStack'
import store, { persistor } from './store'
import { useFonts } from 'expo-font'
import AppLoading from 'expo-app-loading'
import { Font } from 'expo'
import Loading from './components/loading'
function App() {
const [fontLoaded] = useFonts({
Arial: require('./assets/fonts/ARIAL.TTF'),
ArialBold: require('./assets/fonts/ARIALBD.TTF'),
BlairMd: require('./assets/fonts/BlairMdITCTTMediumFont.ttf'),
})
console.log('app font loaded====', fontLoaded)
return fontLoaded ? (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<AuthStack />
</PersistGate>
</Provider>
) : (
<AppLoading />
)
Everything looks fine for me, so I am thinking might because of project setting reasons so I have tried to restart the project, uninstall all packages and install them again, clear cache by running expo r -c. But nothing works.
I appreciate if anyone can help, thank you