【发布时间】:2019-12-12 09:32:51
【问题描述】:
我正在使用 React-Native 创建一个项目,目前当我尝试编译我的代码时,我收到一条错误消息 undefined is not an object (evaluating '_expo_.Asset.loadAsync')
我不完全确定是什么原因造成的,因为我在编译项目之前输入了很多代码。但是,根据我收集到的信息,这可能与我正在导入的字体有关?
目前这是我导入字体的代码。
async componentDidMount() {
await cacheFonts({
georgia: require('../assets/fonts/Georgia.ttf'),
regular: require('../assets/fonts/Montserrat-Regular.ttf'),
light: require('../assets/fonts/Montserrat-Light.ttf'),
});
this.setState({ fontLoaded: true });
}
【问题讨论】:
标签: react-native expo mobile-development react-native-elements