2

Am trying to use an icon from FontAwesom library with React-Native, and this is the import statement:

import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
import { faLock,faAirFreshener,faAnchor, faUserLock } from '@fortawesome/free-solid-svg-icons';

And this is the code where I used it:

     <View style={styles.iconContainer}>
        <FontAwesomeIcon icon={faUserLock} size={40} color={"white"} />
     </View>

When I run the code, the icon appear, but with this error attached in image! Error image Note: am using react-native CLI, not expo!

How to solve it?

Abd26s
  • 21
  • 1
  • Could you add your installed packages? – KiwiKilian Oct 04 '20 at 19:39
  • react-native-svg, @fortawesome/fontawesome-free, @fortawesome/fontawesome-svg-core, @fortawesome/free-solid-svg-icons, @fortawesome/react-native-fontawesome, @fortawesome/free-brands-svg-icons – Abd26s Oct 04 '20 at 19:45
  • I'm not able to reproduce this. Might also be helpful to list the versions of these packages. It probably won't work, but you could try [resetting the cache](https://stackoverflow.com/questions/46878638/how-to-clear-react-native-cache). – 5eb Oct 06 '20 at 21:57
  • @Abd26s Did you ever find a solution? I am getting the same behavior after the last update to RN 0.64.3. – Tim Panagos Feb 02 '22 at 15:58

0 Answers0