React native 在react native中使用矢量图标中的预加载图标

React native 在react native中使用矢量图标中的预加载图标,react-native,preloading,react-native-vector-icons,React Native,Preloading,React Native Vector Icons,我试着在我的Expo应用程序中使用Entypo的矢量图标中的“拇指朝上”图标。我得到一个关于它是自定义字体的错误,我需要使用font.loadAsync。我浏览了这篇文章和其他一些关于stackoverflow的文章,并根据以下内容修改了代码- import React,{useState}来自“React”; 从“react native”导入{样式表、视图、文本}; 从“../components/AppText”导入AppText; 从“../components/Screen”导入屏幕;

我试着在我的Expo应用程序中使用Entypo的矢量图标中的“拇指朝上”图标。我得到一个关于它是自定义字体的错误,我需要使用font.loadAsync。我浏览了这篇文章和其他一些关于stackoverflow的文章,并根据以下内容修改了代码-

import React,{useState}来自“React”;
从“react native”导入{样式表、视图、文本};
从“../components/AppText”导入AppText;
从“../components/Screen”导入屏幕;
从“expo”导入{AppLoading};
从“expo字体”导入*作为字体;
从“@expo/vector icons”导入{Entypo};
异步函数_loadAssetAsync(){
等待承诺.all([Font.loadAsync(Entypo.Font)]);
}
函数安全扫描报告(props){
const[isReady,setIsReady]=useState(false);
如果(!isReady){
返回(
setIsReady(真)}
onError={console.warn}
/>
);
}
否则{
让报告=(
安全进入
);
if(props.permitAccess==false){
报告=(
拒绝访问
);
}
返回(
{报告}
);
}
}
const styles=StyleSheet.create({
容器:{
为内容辩护:“中心”,
对齐项目:“居中”,
},
报告容器:{
弹性:1,
宽度:“100%”,
为内容辩护:“中心”,
对齐项目:“居中”,
填充:8,
}
});
导出默认安全扫描报告;
然而,我仍然得到如下相同的错误。我如何使用事先加载的资产,或者资产是否未正确加载

fontFamily "entypo" 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.
* [native code]:null in __expoConsoleLog
- node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error
- node_modules/expo/build/environment/muteWarnings.fx.js:27:4 in error
- node_modules/expo/node_modules/expo-font/build/Font.js:29:16 in processFontFamily
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:3872:14 in diffProperties
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:3744:37 in addNestedProperty
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:3883:40 in diffProperties
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:4268:28 in createInstance
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:16949:39 in completeWork
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20912:27 in completeUnitOfWork
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20882:29 in performUnitOfWork
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20848:38 in workLoopSync
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20456:22 in performSyncWorkOnRoot
* [native code]:null in performSyncWorkOnRoot
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5703:31 in runWithPriority$argument_1
- node_modules/react-native/node_modules/scheduler/cjs/scheduler.development.js:818:23 in unstable_runWithPriority
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5698:21 in flushSyncCallbackQueueImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5686:28 in flushSyncCallbackQueue
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:19845:30 in scheduleUpdateOnFiber
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:11880:16 in dispatchAction
* [native code]:null in dispatchAction
* app/screens/SecurityScanReport.js:20:18 in AppLoading.props.onFinish
- node_modules/expo/build/launch/AppLoading.js:30:31 in _startLoadingAppResourcesAsync
- node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:293:29 in invoke
- node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:154:27 in invoke
- node_modules/regenerator-runtime/runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
- node_modules/promise/setimmediate/core.js:37:13 in tryCallOne
- node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:135:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:183:16 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:446:30 in callImmediates
* [native code]:null in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:396:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:144:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:373:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue