Nativebase: Icon type isn't working properly or the Icons are very out-to-date.

Created on 28 Feb 2018  路  8Comments  路  Source: GeekyAnts/NativeBase

RN 0.51
NB 2.3.9

I'm just trying to add a "remove" Icon from FontAwesome and I'm getting this:

image

<Icon 
    type="FontAwesome"
    name="remove" 
/>

image

All 8 comments

I doublt there is a "type" prop for Icon, as in the docs, this component only uses Ionicons from react-native-vector-icons

@jarvisluong And why does it come up with that?
image

Oops I was checking the source code again and there is indeed a type prop, but as I saw in the source code, no matter what type of icon we are using, native-base will auto-prepend the icon name with md- if we are in android, and ios- on ios. That's why FontAwesome can't find md-remove

Source code of Icon.js:
https://github.com/GeekyAnts/NativeBase/blob/master/src/basic/Icon/index.js

I will try to add a PR for this!

Yeah, I kinda noticed that on the Icon.js file, but it's weird because it was working like 2 days ago hahaha

Or maybe I was always getting the Ionicons icons and didn't notice it lol

@rafaelgrilli92 now you can have a workaround of specifying icon name for both ios and android like this:

<Icon type="FontAwesome" android="remove" ios="remove" />

Thank you mate! Appreciated :smiley:

1596

Fixed with NB 2.3.10

Was this page helpful?
0 / 5 - 0 ratings