更新到 Expo SDK 51 后 - @expo/vector-icons 停止工作

问题描述 投票:0回答:1

我已将我的项目更新到 Expo SDK 51,矢量图标停止工作。当我从 Expo Go 启动项目时,它不再显示图标。

我尝试按照网上的建议更新 babel 配置:

module.exports = function (api) {
  api.cache(true)
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      'react-native-reanimated/plugin',
      'transform-inline-environment-variables',
      [
        'module-resolver',
        {
          alias: {
            '@': './src',
            '^react-native-vector-icons(/.*)?$': '@expo/vector-icons$1',
          },
        },
      ],
    ],
    env: {
      production: {
        plugins: ['react-native-paper/babel'],
      },
    },
  }
}
react-native expo expo-go
1个回答
0
投票

我确实喜欢这个,

<SymbolView
  name="camera.viewfinder"
  tintColor={color}
  size={18}
  fallback={
    <FontAwesome6 size={16} name="camera" color={color} />
  }
/>

希望有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.