TypeError: undefined is not an object (evaluating 'config.glyphs.forEach') using icomoon in react native

Viewed 214

here by the following code

import React from 'react';
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  View,
  Text,
  StatusBar,
} from 'react-native';

import {createIconSetFromFontello} from 'react-native-vector-icons';
import fontelloConfig from './selection.json';
const Icon =createIconSetFromFontello(fontelloConfig);

export default() => <Icon name="icon-1801287" size={80} color="#bf1313"/>

please how to correct the issues

i add the ttf file to the android assests file i got the same error

1 Answers

selection.json is for icomoon but config.json is for Fontello, so you have to use createIconSetFromIcoMoon(require(./selection.json)) instead of createIconSetFromFontello(require(./selection.json))

Related