expo / vector-icons

https://icons.expo.fyi
MIT License
650 stars 113 forks source link

Some icons don't work #131

Closed moparlakci closed 4 years ago

moparlakci commented 4 years ago

The following icon doesn't show up.

 <TouchableOpacity onPress={onPress}>
     <Ionicons name="ios-cart" size={32} color="black" />
 </TouchableOpacity> `

This one does

<TouchableOpacity onPress={onPress}>
 <Ionicons name="ios-arrow-round-back" size={11} color="white" />
</TouchableOpacity>`

Anyone know a solution?

package.json

{ "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "eject": "expo eject" }, "dependencies": { "@expo/vector-icons": "^10.1.0", "@react-native-community/masked-view": "0.1.5", "@react-navigation/native": "^5.0.5", "@react-navigation/stack": "^5.0.5", "axios": "^0.19.2", "axios-cache-adapter": "^2.5.0", "countries-list": "^2.5.2", "expo": "~36.0.0", "expo-av": "~8.0.0", "expo-location": "~8.0.0", "expo-permissions": "~8.0.0", "expo-sensors": "~8.0.0", "moment": "^2.24.0", "react": "~16.9.0", "react-dom": "~16.9.0", "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz", "react-native-error-boundary": "^1.1.0", "react-native-gesture-handler": "~1.5.0", "react-native-reanimated": "~1.4.0", "react-native-render-html": "^4.2.0", "react-native-safe-area-context": "0.6.0", "react-native-screens": "2.0.0-alpha.12", "react-native-section-list-get-item-layout": "^2.2.3", "react-native-settings-screen": "^2.1.2", "react-native-web": "~0.11.7", "react-native-webview": "7.4.3", "react-native-zoom-lightbox": "0.0.2", "react-number-format": "^4.4.1", "expo-font": "~8.0.0" }, "devDependencies": { "babel-preset-expo": "~8.0.0", "@babel/core": "^7.0.0" }, "private": true }

amandeepmittal commented 4 years ago

Hi @moparlakci

I tried implementing your code snippet in an Expo snack here and seems like, it works. Can you please edit this snack according to the problem or error you are facing?

moparlakci commented 4 years ago

Actually my code was a little bit different, wrote it like this to simplify it. I wrapped the < TouchableOpacity> tag with a <Text> tag and the icon didn't show up. But changed the <Text> to a <View> and worked again.

amandeepmittal commented 4 years ago

Check it out the snack here again. I have wrapped the <TouchableOpacity> with a <Text> component as you have specified. If it doesn't appear as similar as the code snippet you have in your app, then please edit the snack to reflect the same condition.

brentvatne commented 4 years ago

hey sorry snack has an outdated version of vector-icons currently.

on the website (https://icons.expo.fyi/) we now show the @expo/vector-icons version in the header, which at the time of writing is 10.2.0. make sure you're using this version if you would like to refer to the website for which icons you can use. as you can see here ios-cart is available in 10.2.0 :)