最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

babeljs - Expo Vector icons not showing in react native - Stack Overflow

programmeradmin4浏览0评论

Like the title says, my icons are not showing up in my react native project. Here is my babel config file

    module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      'react-native-reanimated/plugin',
      [
        'babel-plugin-module-resolver',
        {
          alias: {
            'react-native-vector-icons': '@expo/vector-icons',
          },
        }
      ]
    ],
  };
};

Like the title says, my icons are not showing up in my react native project. Here is my babel config file

    module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      'react-native-reanimated/plugin',
      [
        'babel-plugin-module-resolver',
        {
          alias: {
            'react-native-vector-icons': '@expo/vector-icons',
          },
        }
      ]
    ],
  };
};
Share Improve this question asked Feb 14 at 4:34 flexwithfrankflexwithfrank 351 gold badge1 silver badge8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

did you called those vector icons in info.plist for ios and added in asset folder in android?

=> you're using expo so update your babel to

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['react-native-reanimated/plugin'],
  };
};

then import directly as

import { MaterialIcons } from '@expo/vector-icons';
发布评论

评论列表(0)

  1. 暂无评论