question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Following docs how to use icons in native-base project didn’t help me to use any icon other than the ones from Ionicons package. I installed react-native-vector-icons and linked with rnpm. Here I see all icon definitions in my project: node_modules/native-base/node_modules/react-native-vector-icons/ If I want to use any other icon, for example “arrow-right” from EvilIcons, I’m getting in my Genymotion emulator: “Warning: Failed prop type: Invalid prop ‘name’ of value ‘arrow-right’ supplied to ‘Icon’, expected one of [‘ios-add’, ‘ios-add-circle’, …]” All these expected icons are defined in Ionicons.js file.

So, how do I get “arrow-right” from EvilIcons package?

Right now I’m doing like this: <Icon name='arrow-right' />

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

23reactions
mk0ycommented, Oct 13, 2016

Think I got it. Import as exact name, not just “Icon”:

import EvilIcons from 'react-native-vector-icons/EvilIcons';

import FontAwesome from 'react-native-vector-icons/FontAwesome';

Then instead using <Icon /> element, use <FontAwesome name='fontawesome-name' /> element.

8reactions
obladorcommented, Oct 13, 2016

You should import your icon directly from this package like this:

import Icon from 'react-native-vector-icons/EvilIcons';
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can icons harm usability and when should you use them?
What are the reasons for using an icon? · The primary attribute for icons is being a common visual language which effectively bridges...
Read more >
10 ways to use icons and images in digital design - 99Designs
Icons add visual accents to digital designs. If you have a lot of info to present, they are a brilliant tool for breaking...
Read more >
UI/UX Principle #20: Use Icons Appropriately
Icons are most effective when they improve visual interest and grab the user's attention. They help guide users while they're navigating a page....
Read more >
Icon Usability - Nielsen Norman Group
Tips for Designing with Icons · Keep the design simple and schematic. · Use the 5-second rule: if it takes you more than...
Read more >
Checklist for Using Icons In UI - UX Planet
Icons are one of the most frequently used elements in graphical user interfaces. In this article, I want to share a simple checklist...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found