I am using Expo and need to use custom fonts in my global stylesheet. Expo documents this, however it is not relevant in my case since componentDidMount() only executes within a class:
class App extends React.Component {
componentDidMount() {
Font.loadAsync({
'open-sans-bold': require('./assets/fonts/OpenSans-Bold.ttf'),
});
}
// ...
}
My global stylesheet looks like this:
const React = require('react-native');
import {
Dimensions,
StatusBar,
} from 'react-native';
const { StyleSheet } = React;
export default {
// ...
}