我正在使用 React Native (V-0.64)。我使用了在assets文件夹中下载和添加自定义字体并创建一个react-native.config.js
文件并从那里导出链接的方法。但是当我在设备上运行应用程序时,我不断收到以下错误。文件中的代码
module.exports = {
assets: ['./assets/fonts'],
};
然后运行将npx react-native link
资产链接到 android 和 iOS 文件。但是我在行中不断收到以下错误并且没有在文本中获得字体更改
fontFamily "VeganStylePersonalUse-5Y58" 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.
at node_modules/expo-font/build/Font.js:27:16 in processFontFamily
at [native code]:null in commitRootImpl
at [native code]:null in performSyncWorkOnRoot
at [native code]:null in forEach
at node_modules/react-native/Libraries/Core/setUpReactRefresh.js:43:6 in Refresh.performReactRefresh
at [native code]:null in callFunctionReturnFlushedQueue
我尝试了很多东西,但没有奏效。请帮忙。