Loading fonts with createBottomTabNavigator

Please provide the following:

  1. SDK Version: 35.0.0
  2. Platforms(Android/iOS/web/all): all

Hi all, I’m using createBottomTabNavigator as my top level component in an app. I’d also like to add a componentDid()Mount() callback to that top level component so I can load a custom font when my app mounts.

Is it possible to add a componentDidMount() event to the object returned by createBottomTabNavigator()? If not, is there another approach to ensuring that I can load my fonts while using the bottom tab navigator? Any suggestions would be appreciated!

Easiest solution seemed to be to just load the font inside the first route the navigator render rather than inside the Navigator itself.

Hey @duhaime,

I would recommend handling the asset/font loading with the AppLoading module https://docs.expo.io/versions/v35.0.0/sdk/app-loading/ so that you can be assured it’s ready for use before any of your app is rendered.


1 Like

Amen, that’s my next step!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.